import { OTPInput, SlotProps } from 'input-otp'; import { cn } from '@/lib/utils'; export type OTPInputWrapperType = { onChange: (value: string) => void; }; export default function OTPInputWrapper({ ...props }: OTPInputWrapperType) { return ( props.onChange(value)} render={({ slots }) => (
{slots.slice(0, 3).map((s, idx) => ( ))}
-
{slots.slice(3).map((s, idx) => ( ))}
)} /> ); } const Slot = (props: SlotProps) => { return (
{props.char !== null &&
{props.char}
}
); };