"use client" import * as React from "react" import { Check, ChevronsUpDown } from "lucide-react" import { cn } from "@/lib/utils" import { Button } from "@/components/ui/button" import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command" import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover" interface ComboboxProps { items: { label: string; value: string }[] value: string onChange: (value: string) => void placeholder?: string } export function Combobox({ items, value, onChange, placeholder = "选择选项..." }: ComboboxProps) { const [open, setOpen] = React.useState(false) return ( 未找到结果 {items.map((item) => ( { onChange(currentValue === value ? "" : currentValue) setOpen(false) }} > {item.label} ))} ) }