'use client' import * as React from 'react' import { CaretSortIcon, CheckIcon } from '@radix-ui/react-icons' import { Button } from '@/components/ui/button' import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem } from '@/components/ui/command' import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover' import { cn } from '@/lib/utils' import { ScrollArea } from '../ui/scroll-area' type Framework = { value: string label: string } export function ComboboxDemo({ frameworks, setValue, value, }: { frameworks: Framework[] setValue: (value: string) => void value: string }): JSX.Element { const [open, setOpen] = React.useState(false) return ( No functions found. {frameworks.map((framework) => ( { // search for current value setValue(framework.value === value ? '' : framework.value) setOpen(false) }}> {framework.label} ))} ) }