import React from "react"; import { get } from "lodash"; import { Controller, useFormContext } from "react-hook-form"; import { twMerge } from "tailwind-merge"; import { Field, FieldProps } from "./Field"; export const TextAreaField = ( props: FieldProps & React.HTMLProps & { handleChanged?: (props: { name: string }) => void; startIcon?: React.ReactNode; }, ) => { const { name, label, required, disabled, className, labelClassName, childrenWrapperClassName, hideErrorMessage = false, startIcon, handleChanged, ...rest } = props; const form = useFormContext(); const { formState: { errors }, } = form; const hasError = !!get(errors, name)?.message; return (
(
{startIcon && (
{startIcon}
)}