website cleanup

This commit is contained in:
2025-12-24 21:44:58 +01:00
parent 9b683a59d3
commit d78854a4c6
277 changed files with 6141 additions and 2693 deletions

View File

@@ -41,6 +41,8 @@ import type { TeamSummaryViewModel } from '@/lib/view-models/TeamSummaryViewMode
type TeamDisplayData = TeamSummaryViewModel;
type SkillLevel = 'pro' | 'advanced' | 'intermediate' | 'beginner';
// ============================================================================
// SKILL LEVEL CONFIG
// ============================================================================
@@ -126,9 +128,9 @@ export default function TeamsPage() {
// Select top teams by rating for the preview section
const topTeams = useMemo(() => {
const sortedByRating = [...teams].sort((a, b) => {
const aRating = typeof a.rating === 'number' && Number.isFinite(a.rating) ? a.rating : 0;
const bRating = typeof b.rating === 'number' && Number.isFinite(b.rating) ? b.rating : 0;
return bRating - aRating;
// Rating is not currently part of TeamSummaryViewModel in this build.
// Keep deterministic ordering by name until a rating field is exposed.
return a.name.localeCompare(b.name);
});
return sortedByRating.slice(0, 5);
}, [teams]);
@@ -172,7 +174,7 @@ export default function TeamsPage() {
intermediate: [],
advanced: [],
pro: [],
} as Record<string, typeof teams>,
} as Record<string, TeamSummaryViewModel[]>,
);
}, [groupsBySkillLevel, filteredTeams]);
@@ -373,7 +375,7 @@ export default function TeamsPage() {
<div key={level.id} id={`level-${level.id}`} className="scroll-mt-8">
<SkillLevelSection
level={level}
teams={teamsByLevel[level.id]}
teams={teamsByLevel[level.id] ?? []}
onTeamClick={handleTeamClick}
defaultExpanded={index === 0}
/>
@@ -383,4 +385,4 @@ export default function TeamsPage() {
)}
</div>
);
}
}