import Image from "next/image"; // react-hook-form import { Controller } from "react-hook-form"; // components import { FormComponentProps, Input } from "components/custom-attributes"; // icons import { CheckCircle2 } from "lucide-react"; // assets import CheckRepresentation from "public/custom-attributes/checkbox/check.svg"; import ToggleSwitchRepresentation from "public/custom-attributes/checkbox/toggle-switch.svg"; const checkboxAttributeRepresentations = [ { image: CheckRepresentation, key: "check", label: "Check", }, { image: ToggleSwitchRepresentation, key: "toggle_switch", label: "Toggle Switch", }, ]; export const CheckboxAttributeForm: React.FC = ({ control }) => ( <>
{" "} ( )} />

Default value

Show as
( <> {checkboxAttributeRepresentations.map((representation) => (
onChange(representation.key)} >
{representation.label}
{representation.label} {value === representation.key && ( )}
))} )} />
);