import { Button, FormControl, FormField, FormItem, FormLabel, FormMessage, Input, } from "@marzneshin/common/components"; import { useFormContext } from "react-hook-form"; import { X } from "lucide-react"; export const ClearableTextField = ({ name, label, placeholder = "", }: { name: string; label: string; placeholder?: string; }) => { const form = useFormContext(); const value = form.watch(name); const handleNullify = () => { form.setValue(name, null); }; const handleRestore = () => { form.setValue(name, ""); }; return ( ( {label}
{value === null ? (
null
) : ( )}
)} /> ); };