/** * Assignments tab — maps each component to a primary provider+model with * an optional fallback. Settings column packs temp/max/timeout into one * caption row to keep the table scannable. */ import React from 'react'; import { Box, TableContainer, Table, TableHead, TableBody, TableRow, TableCell, Button, Chip, IconButton, Switch, Typography, } from '@mui/material'; import { Add as AddIcon, Edit as EditIcon, Delete as DeleteIcon } from '@mui/icons-material'; import type { ComponentAssignment } from '../ProvidersManagement.types'; interface Props { assignments: ComponentAssignment[]; hasProvidersAndModels: boolean; onAdd: () => void; onEdit: (a: ComponentAssignment) => void; onDelete: (a: ComponentAssignment) => void; onToggleEnabled: (a: ComponentAssignment) => void; } export const AssignmentsTab: React.FC = ({ assignments, hasProvidersAndModels, onAdd, onEdit, onDelete, onToggleEnabled }) => ( <> Component Provider / Model Fallback Settings Enabled Actions {assignments.map((a) => ( {a.component_name} {a.component_code} {a.fallback_provider_code ? ( <> ) : '-'} temp: {a.temperature} | max: {a.max_tokens} | timeout: {a.timeout_ms}ms onToggleEnabled(a)} size="small" /> onEdit(a)}> onDelete(a)} color="error"> ))}
);