// react-hook-form import { Controller, useForm } from "react-hook-form"; // headless ui import { Disclosure } from "@headlessui/react"; // ui import { CustomSelect, ToggleSwitch } from "components/ui"; import { Input } from "../input"; // icons import { ChevronDown } from "lucide-react"; // types import { ICustomAttribute } from "types"; // constants import { CUSTOM_ATTRIBUTES_LIST, CUSTOM_ATTRIBUTE_UNITS } from "constants/custom-attributes"; type Props = {}; const defaultFormValues: Partial = { display_name: "", is_multi: false, is_required: false, unit: "cycle", }; export const RelationAttributeForm: React.FC = () => { const { control } = useForm({ defaultValues: defaultFormValues }); const typeMetaData = CUSTOM_ATTRIBUTES_LIST.relation; return ( {({ open }) => ( <>
{typeMetaData.label}
( )} /> ( {value}} value={value} onChange={onChange} buttonClassName="bg-custom-background-100 !px-3 !py-2 !border-custom-border-200 !rounded" optionsClassName="w-full" input > {CUSTOM_ATTRIBUTE_UNITS.map((unit) => { if (unit.value === "user") return null; return ( {unit.label} ); })} )} />

Selection type

( )} /> Mandatory field
)}
); };