diff --git a/app/components/ui/select.tsx b/app/components/ui/select.tsx deleted file mode 100644 index ad22f82..0000000 --- a/app/components/ui/select.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { Field, Label, Select as HeadlessSelect } from '@headlessui/react' -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' - -type TInputProperties = Omit< - ComponentProps<'select'>, - 'size' -> & { - id: string - label?: ReactNode - name: Path - rules?: RegisterOptions - placeholder?: string - options?: { - code: string - name: string - id: string - }[] -} - -export const Select = >( - properties: TInputProperties, -) => { - const { id, label, name, rules, disabled, placeholder, options, ...rest } = - properties - - const { - register, - formState: { errors }, - } = useRemixFormContext() - - const error: FieldError = get(errors, name) - - return ( - - - - - {options?.map(({ id, name }) => ( - - ))} - - - ) -}