"use client" import { OTPInput, OTPInputContext, OTPInputProps as BaseOTPInputProps} from 'input-otp'; import * as React from 'react'; import { MinusIcon } from '@radix-ui/react-icons'; import { cn } from '../../../lib/utils'; type ChildrenBranch = Extract; type InputOTPProps = Omit & { className?: string; containerClassName?: string; } & { children: React.ReactNode; } const InputOTP = React.forwardRef< React.ElementRef, InputOTPProps >(({ className, containerClassName, children, ...props }, ref) => ( {children} )) InputOTP.displayName = "InputOTP" const InputOTPGroup = React.forwardRef< React.ElementRef<"div">, React.ComponentPropsWithoutRef<"div"> >(({ className, ...props }, ref) => (
)) InputOTPGroup.displayName = "InputOTPGroup" const InputOTPSlot = React.forwardRef< React.ElementRef<"div">, React.ComponentPropsWithoutRef<"div"> & { index: number } >(({ index, className, ...props }, ref) => { const inputOTPContext = React.useContext(OTPInputContext) const slot = inputOTPContext.slots[index] if (!slot) return null const { char, hasFakeCaret, isActive } = slot return (