import { Field, Label, Input as HeadlessInput } from '@headlessui/react' import { CloudArrowUpIcon } from '@heroicons/react/20/solid' import { type ComponentProps, type ReactNode } from 'react' import { get, type FieldError, type FieldValues, type Path, type RegisterOptions, } from 'react-hook-form' import { useRemixFormContext } from 'remix-hook-form' import { twMerge } from 'tailwind-merge' import { useAdminContext } from '~/contexts/admin' import { Button } from './button' type TInputProperties = Omit< ComponentProps<'input'>, 'size' > & { id: string label?: ReactNode name: Path rules?: RegisterOptions containerClassName?: string labelClassName?: string } export const InputFile = >( properties: TInputProperties, ) => { const { id, label, name, rules, placeholder, disabled, className, containerClassName, labelClassName, ...restProperties } = properties const { setIsUploadOpen } = useAdminContext() const { register, formState: { errors }, } = useRemixFormContext() const error: FieldError = get(errors, name) return ( ) }