refactor(forklifts): more refactoring to improve during production

This commit is contained in:
2025-11-20 19:47:52 -06:00
parent 7b6c9bdfbf
commit 8c0f67ca35
8 changed files with 68 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
import { Textarea } from "@/components/ui/textarea";
import { Label } from "../../../components/ui/label";
import { useFieldContext } from "..";
import { FieldErrors } from "./FieldErrors";
type InputFieldProps = {
label: string;
placeHolder: string;
required: boolean;
};
export const TextArea = ({ label, placeHolder, required }: InputFieldProps) => {
const field = useFieldContext<any>();
return (
<div className="grid gap-3 w-64">
<Label htmlFor={field.name}>{label}</Label>
<Textarea
id={field.name}
value={field.state.value}
onChange={(e) => field.handleChange(e.target.value)}
placeholder={placeHolder}
onBlur={field.handleBlur}
required={required}
/>
<FieldErrors meta={field.state.meta} />
</div>
);
};