import { CheckIcon, ChevronsUpDownIcon } from "lucide-react"; import { useState } from "react"; 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"; import { cn } from "@/lib/utils"; export function ModelSelector({ options, value, onValueChange, icon, }: { options: { value: string; label: string; default?: boolean; }[]; value: string; icon?: React.ReactNode; onValueChange: (value: string) => void; }) { const [open, setOpen] = useState(false); return ( No model found. {options.map((option) => ( { if (currentValue !== value) { onValueChange(currentValue); } setOpen(false); }} >
{option.label} {option.default && ( Default )}
))}
); }