'use client'
import React from 'react'
import { OTPInput, SlotProps } from 'input-otp'
import { cn } from '@/lib/utils'
type Mode = 'light' | 'dark'
interface Props {
mode?: Mode
}
function OtpForm({ mode = 'light' }: Props) {
return (
Verify your code
We have sent a code to your email johndoe@gmail.com
(
<>
{slots.slice(0, 3).map((slot, idx) => (
))}
{slots.slice(3).map((slot, idx) => (
))}
>
)}
/>
Didn‘t receive code?
Resend
)
}
function Slot(props: SlotProps & { mode: Mode }) {
return (
{props.char !== null &&
{props.char}
}
{props.hasFakeCaret &&
}
)
}
function FakeCaret({ mode }: { mode: Mode }) {
return (
)
}
function FakeDash() {
return (
)
}
export default OtpForm;