)
}
// Group files by round name or "General"
const grouped: Record = {}
for (const file of files) {
const groupName = file.requirement?.round?.name ?? 'General'
if (!grouped[groupName]) grouped[groupName] = []
grouped[groupName].push(file)
}
const groupNames = Object.keys(grouped)
return (
Documents
{files.length} file{files.length !== 1 ? 's' : ''} submitted
{groupNames.length === 1 ? (
// Single group — no need for headers