import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@repo/shadcn-ui/components/select"; import type { ReactNode } from "react"; import { useId } from "react"; import { FormLabel } from "./form-label"; /** Selección compacta con vista previa; el consumidor aporta iconos, textos y claves válidas. */ export function IconPicker({ label, description, describedBy, options, value, onChange, disabled = false, }: { label: string; description?: string; describedBy?: string; options: readonly { value: string; label: string; icon: ReactNode }[]; value: string; onChange: (value: string) => void; disabled?: boolean; }) { const id = useId(); const selected = options.find((option) => option.value === value); const descriptionIds = [description ? `${id}-description` : undefined, describedBy].filter(Boolean).join(" ") || undefined; return (
{description}
)}