import { useId } from "react"; import { cn } from "@/shared/ui/cn"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/shared/ui/select"; export interface FieldSelectOption { value: string; label: string; disabled?: boolean; } export interface FieldSelectProps { label: string; value: string; onValueChange: (value: string) => void; options: FieldSelectOption[]; placeholder?: string; disabled?: boolean; className?: string; contentClassName?: string; id?: string; } export function FieldSelect({ label, value, onValueChange, options, placeholder = "请选择", disabled, className, contentClassName, id }: FieldSelectProps) { const generatedId = useId(); const triggerId = id ?? `field-select-${generatedId}`; const selectableOptions = options.filter((option) => option.value !== ""); return (
); }