'use client'; import * as React from 'react'; import { Check, ChevronsUpDown, X } from 'lucide-react'; import { cn } from '@/lib/helper'; import { Button } from '@/figma-make/components/base/button'; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from '@/figma-make/components/base/command'; import { Popover, PopoverContent, PopoverTrigger, } from '@/figma-make/components/base/popover'; import { Badge } from '@/figma-make/components/base/badge'; export interface Option { value: string; label: string; } interface MultiSelectProps { options: Option[]; selected: string[]; onChange: (selected: string[]) => void; onSearchChange?: (value: string) => void; placeholder?: string; className?: string; disabled?: boolean; } export function MultiSelect({ options, selected, onChange, onSearchChange, placeholder = 'Select items...', className, disabled, }: MultiSelectProps) { const [open, setOpen] = React.useState(false); const handleUnselect = (item: string) => { onChange(selected.filter((i) => i !== item)); }; const handleSelect = (item: string) => { if (selected.includes(item)) { handleUnselect(item); } else { onChange([...selected, item]); } }; return ( No item found. {options.map((option) => ( handleSelect(option.value)} className='cursor-pointer' > {option.label} ))} ); }