import clsx from 'clsx' import { ComponentPropsWithoutRef } from 'react' import { FieldError, FieldPathValue, FieldValues, Path, UseFormRegister, Validate, } from 'react-hook-form' import { useTranslation } from 'react-i18next' export interface TextAreaInputProps< FV extends FieldValues, FieldName extends Path, > extends Omit, 'required'> { fieldName: FieldName register: UseFormRegister validation?: Validate>[] error?: FieldError required?: boolean } export const TextAreaInput = < FV extends FieldValues, FieldName extends Path, >({ fieldName, register, error, validation, className, required, ...rest }: TextAreaInputProps) => { const { t } = useTranslation() const validate = validation?.reduce( (a, v) => ({ ...a, [v.toString()]: v }), {} ) return ( ) }