import type { FormFieldItems, FormFieldProps } from "../types"; import { FormFieldMessages } from "./FormFieldWrapper"; import { SelectFormField } from "./SelectFormField"; type DualSelectFormFieldProps = Omit< FormFieldProps<"dual-select">, "clearable" > & { fields: [ { label?: string; items: FormFieldItems }, { label?: string; items: FormFieldItems }, ]; value: [V | null, V | null]; onChange: (value: [V | null, V | null]) => void; }; export function DualSelectFormField({ name, bottomText, error, onBlur, value, onChange, fields, }: DualSelectFormFieldProps) { return (
onChange([newValue, value[1]])} onBlur={onBlur} clearable /> onChange([value[0], newValue])} onBlur={onBlur} clearable />
); }