"use client"; import { X } from "lucide-react"; import { CONTROL_CLASS } from "./Field"; // Dropdown-to-add, chip-to-remove multi-select for short, fixed option // lists (no search needed) — e.g. academic titles. The dropdown only offers // options not yet picked; the reset key forces the so a surrounding can label it. id, "aria-describedby": describedBy, }: { options: string[]; value: string[]; onChange: (value: string[]) => void; placeholder?: string; id?: string; "aria-describedby"?: string; }) { const available = options.filter((o) => !value.includes(o)); function remove(option: string) { onChange(value.filter((v) => v !== option)); } return (
{value.length > 0 && (
{value.map((v) => ( {v} ))}
)}
); }