feat: enhance TextEditor and Input components with improved styling and error handling
This commit is contained in:
@@ -23,6 +23,7 @@ type TInputProperties<T extends FieldValues> = Omit<
|
||||
name: Path<T>
|
||||
rules?: RegisterOptions
|
||||
containerClassName?: string
|
||||
labelClassName?: string
|
||||
}
|
||||
|
||||
export const Input = <TFormValues extends Record<string, unknown>>(
|
||||
@@ -38,6 +39,7 @@ export const Input = <TFormValues extends Record<string, unknown>>(
|
||||
disabled,
|
||||
className,
|
||||
containerClassName,
|
||||
labelClassName,
|
||||
...rest
|
||||
} = properties
|
||||
const [inputType, setInputType] = useState(type)
|
||||
@@ -55,7 +57,7 @@ export const Input = <TFormValues extends Record<string, unknown>>(
|
||||
disabled={disabled}
|
||||
id={id}
|
||||
>
|
||||
<Label className="mb-1 block text-gray-700">
|
||||
<Label className={twMerge('mb-1 block text-gray-700', labelClassName)}>
|
||||
{label} {error && <span className="text-red-500">{error.message}</span>}
|
||||
</Label>
|
||||
<HeadlessInput
|
||||
|
||||
Reference in New Issue
Block a user