"use client"; import * as React from "react"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { HiChevronDown, HiCheck } from "react-icons/hi2"; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, } from "@/components/ui/command"; import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; type PickerProps = { options: T[]; value: string | undefined; noun: string; placeholder: string; onChange: (val: T) => void; className?: string; pre?: React.ReactNode; }; export default function Picker({ value, onChange, options, noun, placeholder, className, pre, }: PickerProps) { const [open, setOpen] = React.useState(false); return ( {`No ${noun} Found.`} {options.map((option) => ( { onChange(option); setOpen(false); }} > {option.label} ))} ); }