import { useId } from 'react' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import { Label } from '@/components/ui/label' import { useModels } from '@/lib/hooks/use-models' import { LoadingSpinner } from '@/components/common/LoadingSpinner' import { useTranslation } from '@/lib/hooks/use-translation' interface ModelSelectorProps { id?: string name?: string label?: string modelType: 'language' | 'embedding' | 'speech_to_text' | 'text_to_speech' value: string onChange: (value: string) => void placeholder?: string disabled?: boolean } export function ModelSelector({ id, name, label, modelType, value, onChange, placeholder, disabled = false }: ModelSelectorProps) { const { t } = useTranslation() const { data: models, isLoading } = useModels() const derivedId = useId() const selectId = id || derivedId // Filter models by type const filteredModels = models?.filter(model => model.type === modelType) || [] return (