'use client'; import * as React from 'react'; import { CheckIcon, ChevronsUpDownIcon } from '@/icons'; import { cn } from '@/lib/utils'; import { useControllableState } from '@/hooks/use-controllable-state'; import { Button } from '@/components/button/button'; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from '@/components/command/command'; import { Popover, PopoverContent, PopoverTrigger, } from '@/components/popover/popover'; export interface ComboboxOption { label: string; value: string; disabled?: boolean; } export interface ComboboxProps { options: ComboboxOption[]; /** Controlled selection. Pass with `onValueChange`. */ value?: string; defaultValue?: string; onValueChange?: (value: string) => void; /** Shown on the trigger when nothing is selected. */ placeholder?: string; searchPlaceholder?: string; emptyMessage?: string; disabled?: boolean; /** Width of the trigger. The popover matches it. */ className?: string; /** Extra classes for the popover surface. */ contentClassName?: string; /** Put it on the trigger, so a `