{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "passkey-verify", "dependencies": [ "@laravel/passkeys", "@inertiajs/react" ], "registryDependencies": [ "@craft/use-error-toast", "button" ], "files": [ { "path": "registry/new-york-v4/components/passkey-verify.tsx", "content": "import type { UrlMethodPair } from \"@inertiajs/core\";\nimport { router } from \"@inertiajs/react\";\nimport { usePasskeyVerify } from \"@laravel/passkeys/react\";\nimport { KeyRound } from \"lucide-react\";\nimport InputError from \"@/components/input-error\";\nimport { useErrorToast } from \"@/hooks/use-error-toast\";\nimport { Button } from \"@/components/ui/button\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { Spinner } from \"@/components/ui/spinner\";\n\ntype Props = {\n routes?: {\n options: UrlMethodPair;\n submit: UrlMethodPair;\n };\n label?: string;\n loadingLabel?: string;\n separator?: string;\n};\n\nexport default function PasskeyVerify({ routes, label, loadingLabel, separator }: Props = {}) {\n const { verify, isLoading, error, isSupported } = usePasskeyVerify({\n ...(routes && {\n routes: {\n options: routes.options.url,\n submit: routes.submit.url,\n },\n }),\n onSuccess: (response) => {\n router.visit(response.redirect ?? \"/dashboard\");\n },\n });\n\n useErrorToast(error);\n\n if (!isSupported) {\n return null;\n }\n\n return (\n <>\n
\n \n {isLoading ? : }\n {isLoading\n ? (loadingLabel ?? \"Authenticating...\")\n : (label ?? \"Sign in with a passkey\")}\n \n {error && }\n
\n\n
\n
\n \n
\n
\n \n {separator ?? \"Or continue with email\"}\n \n
\n
\n \n );\n}\n", "type": "registry:component" } ], "type": "registry:component" }