'use client'; import { Box, Typography, Checkbox, FormHelperText, FormControl, InputLabel, Select, MenuItem, ListItemText, OutlinedInput, Chip } from '@mui/material'; import { useTranslation } from 'react-i18next'; export default function ModelSelector({ models, selectedModels, onSelectionChange, error }) { const { t } = useTranslation(); const getModelKey = model => `${model.providerId}::${model.modelId}`; const handleChange = event => { const { target: { value } } = event; // On autofill we get a stringified value. onSelectionChange(typeof value === 'string' ? value.split(',') : value); }; const getModelLabel = modelKey => { const model = models.find(m => getModelKey(m) === modelKey); if (!model) return modelKey; return `${model.providerName || model.providerId} / ${model.modelName || model.modelId}`; }; return ( {t('evalTasks.selectModels')} * {error || t('evalTasks.selectModelsHint')} ); }