"use client"; import { ChevronDown } from "lucide-react"; import type { ReactNode } from "react"; import { Button } from "./button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "./dropdown-menu"; import { cn } from "../../lib/utils"; export type OptionSelectItem = { value: T; label: string; }; type OptionSelectProps = { value: T; onValueChange: (value: T) => void; options: readonly OptionSelectItem[]; placeholder?: string; disabled?: boolean; className?: string; triggerClassName?: string; contentClassName?: string; align?: "start" | "center" | "end"; children?: ReactNode; }; function OptionSelect({ value, onValueChange, options, placeholder = "Select", disabled, className, triggerClassName, contentClassName, align = "start", children, }: OptionSelectProps) { const activeLabel = options.find((option) => option.value === value)?.label ?? placeholder; return ( {options.map((option) => ( onValueChange(option.value)} > {option.label} ))} ); } export { OptionSelect };