recovery-code.tsx
"use client"
import { useId } from "react"
import Link from "next/link"
import { Button } from "@/components/ui/button"
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import { FancyButton } from "@/components/ui/fancy-button"
import { Icons } from "@/components/ui/icons"
export function RecoveryCode() {
const id = useId()
return (
<main
aria-label="Recovery code"
className="flex w-full max-w-sm flex-col items-center gap-4 text-foreground motion-reduce:**:animate-none motion-reduce:**:transition-none"
>
<FancyButton
size="icon-lg"
aria-label="Home"
role="link"
className="size-14 rounded-xl"
render={<Link href="/" />}
>
<Icons.Logo aria-hidden="true" className="size-10" />
</FancyButton>
<div className="flex w-full flex-col gap-6 rounded-4xl bg-card p-6 shadow-elevated-lg">
<div className="text-center">
<h1 className="text-xl font-semibold tracking-tight text-balance sm:text-2xl">
Recovery code
</h1>
<p className="text-base text-muted-foreground">
Enter the recovery code you saved when setting up your account.
</p>
</div>
<FieldGroup className="gap-3">
<Field className="gap-1">
<FieldLabel htmlFor={`${id}-recovery-code`}>
Recovery code
</FieldLabel>
<Input
id={`${id}-recovery-code`}
type="text"
placeholder="abcd-efgh-ijkl-mnop"
className="h-10 bg-transparent"
/>
</Field>
<FancyButton type="button" size="lg" className="w-full">
Verify code
</FancyButton>
</FieldGroup>
</div>
<div className="flex flex-wrap items-center justify-center gap-x-1 gap-y-0.5 text-sm text-muted-foreground">
<span>Having trouble?</span>
<Button
variant="link"
className="h-auto p-0"
nativeButton={false}
role="link"
render={<Link href="/sign-in" />}
>
Back to login
</Button>
</div>
</main>
)
}




























