import { Label } from "@/components/ds/ui/label"; import { Input } from "@/components/ds/ui/input"; import { Button } from "@/components/ds/ui/button"; import { AlertCircle } from "lucide-react"; import { motion } from "framer-motion"; import { useTranslate } from "ra-core"; interface CredentialsStepProps { url: string; anonKey: string; error: string | null; onUrlChange: (value: string) => void; onAnonKeyChange: (value: string) => void; onSave: () => void; onBack: () => void; } export function CredentialsStep({ url, anonKey, error, onUrlChange, onAnonKeyChange, onSave, onBack, }: CredentialsStepProps) { const translate = useTranslate(); const canSubmit = url.trim().length > 0 && anonKey.trim().length > 0; // Keyboard shortcuts const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === "Enter" && canSubmit) { e.preventDefault(); onSave(); } else if (e.key === "Escape") { e.preventDefault(); onBack(); } }; return (

{translate("setup.manualSync")}

{translate("setup.injectCoordinates")}

onUrlChange(e.target.value)} className="bg-muted/20 border-border/50 rounded-xl h-12" aria-describedby="url-help" aria-invalid={error ? "true" : "false"} autoFocus />

{translate("setup.urlHelp")}

onAnonKeyChange(e.target.value)} className="bg-muted/20 border-border/50 rounded-xl h-12" aria-describedby="key-help" aria-invalid={error ? "true" : "false"} />

{translate("setup.keyHelp")}

{error && ( )}
); }