import { memo } from 'react' import { Checkbox } from '@/components/ui/checkbox' import type { ModelSection } from '@/lib/modelSections' interface ModelCheckboxListProps { sections: ModelSection[] selectedModels: string[] onToggle: (value: string, checked: boolean) => void emptyLabel: string maxSelected?: number } export const ModelCheckboxList = memo(function ModelCheckboxList({ sections, selectedModels, onToggle, emptyLabel, maxSelected, }: ModelCheckboxListProps) { if (sections.length === 0) { return

{emptyLabel}

} return ( <> {sections.map((section) => (

{section.icon ? : null} {section.title}

{section.options.map((option) => { const checked = selectedModels.includes(option.value) const atCapacity = maxSelected !== undefined && selectedModels.length >= maxSelected && !checked return ( ) })}
))} ) })