'use client'; import { OTPInput, OTPInputContext } from 'input-otp'; import Minus from 'lucide-react/dist/esm/icons/minus'; import * as React from 'react'; import { cn } from '@/lib/utils'; const InputOTP = ({ ref, className, containerClassName, ...props }: React.ComponentPropsWithoutRef & { ref?: React.RefObject | null> }) => ( ); InputOTP.displayName = 'InputOTP'; const InputOTPGroup = ({ ref, className, ...props }: React.ComponentPropsWithoutRef<'div'> & { ref?: React.RefObject | null> }) => (
); InputOTPGroup.displayName = 'InputOTPGroup'; const InputOTPSlot = ({ ref, index, className, ...props }: React.ComponentPropsWithoutRef<'div'> & { index: number } & { ref?: React.RefObject | null> }) => { const inputOTPContext = React.use(OTPInputContext); const slot = inputOTPContext.slots[index]; const { char, hasFakeCaret, isActive } = slot || { char: null, hasFakeCaret: false, isActive: false }; return (
{char} {hasFakeCaret && (
)}
); }; InputOTPSlot.displayName = 'InputOTPSlot'; const InputOTPSeparator = ({ ref, ...props }: React.ComponentPropsWithoutRef<'div'> & { ref?: React.RefObject | null> }) => (
); InputOTPSeparator.displayName = 'InputOTPSeparator'; export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };