import { useMemo, useState } from "react"; import { Fingerprint } from "lucide-react"; import { toast } from "sonner"; import { Button } from "@termix/plugin-sdk/ui"; import { usePluginApi, useTranslation, type LoginMethodUIProps, } from "@termix/plugin-sdk/frontend"; import { createWebAuthnApi, isPasskeySupported } from "./webauthn-api"; export function PasskeyLoginButton({ disabled, submit, username, }: LoginMethodUIProps) { const { t } = useTranslation(); const pluginApi = usePluginApi(); const api = useMemo(() => createWebAuthnApi(pluginApi), [pluginApi]); const [loading, setLoading] = useState(false); const [supported] = useState(isPasskeySupported); if (!supported) return null; return ( ); }