"use client" import { Check, ChevronsUpDown } from "lucide-react" 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 { useState } from "react" type Option = { key: string, label: string, } export function Combox( { options, currentKey, onShow, }: { options: Option[], currentKey: string | null, onShow: ((key: string) => void), }) { const [open, setOpen] = useState(false) return (

No option found. {options.map((option) => ( { // setCurrentKey(option.key) setOpen(false) onShow(option.key) }} > {option.label} ))}
) }