import React, { useState } from "react"; import { Button } from "@/components/ui/button.tsx"; import { Input } from "@/components/ui/input.tsx"; import { Label } from "@/components/ui/label.tsx"; import { Shield, Copy, ExternalLink } from "lucide-react"; import { useTranslation } from "react-i18next"; import { toast } from "sonner"; interface WarpgateDialogProps { isOpen: boolean; url: string; securityKey: string; onContinue: () => void; onCancel: () => void; onOpenUrl: () => void; backgroundColor?: string; } export function WarpgateDialog({ isOpen, url, securityKey, onContinue, onCancel, onOpenUrl, backgroundColor, }: WarpgateDialogProps) { const { t } = useTranslation(); const [copied, setCopied] = useState(false); if (!isOpen) return null; const handleCopyUrl = async () => { try { await navigator.clipboard.writeText(url); setCopied(true); toast.success(t("common.copied")); setTimeout(() => setCopied(false), 2000); } catch (error) { toast.error(t("common.copyFailed")); } }; return (

{t("terminal.warpgateAuthRequired")}

{securityKey}
); }