diff --git a/app/components/home/tab-content.tsx b/app/components/home/tab-content.tsx index 96268d3..620a782 100644 --- a/app/components/home/tab-content.tsx +++ b/app/components/home/tab-content.tsx @@ -46,8 +46,12 @@ export default function TabContent({ ); for (const day of days) { // Group by examiner name/subject then sort by date - collesByDay[day]?.sort((a, b) => a.examiner.name?.localCompare(b.examiner.name)) - .sort((a, b) => new Date(a?.date).getTime() - new Date(b?.date).getTime()) + collesByDay[day]?.sort((a, b) => { + const nameA = a?.examiner?.name || ""; + const nameB = b?.examiner?.name || ""; + return nameA.localeCompare(nameB); + }) + collesByDay[day]?.sort((a, b) => new Date(a?.date).getTime() - new Date(b?.date).getTime()) if (!isSorted) { collesByDay[day].reverse() }