From 966554e615530c0de35ec280aa633eaf16968f4d Mon Sep 17 00:00:00 2001 From: Robin Schanbacher Date: Tue, 25 Aug 2026 13:38:22 +0200 Subject: [PATCH] feat: sort table by time --- app/evaluation/page.tsx | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/app/evaluation/page.tsx b/app/evaluation/page.tsx index 4d08555..b5ec10c 100644 --- a/app/evaluation/page.tsx +++ b/app/evaluation/page.tsx @@ -120,20 +120,23 @@ export default async function EvaluationPage({ searchParams }: PageProps) { - {Object.entries(times).map(([category, minutes]) => ( - - {category} - - {Math.floor(minutes / 60)}:{Math.round(minutes % 60)}h (={Math.round(minutes)} min) - - - {total > 0 ? Math.round((minutes / total) * 1000) / 10 : 0}% - - - {total > 0 ? Math.round((minutes / (daysToFetch * 24 * 60)) * 1000) / 10 : 0}% - - - ))} + {Object.entries(times) + .sort(([, minutesA], [, minutesB]) => minutesB - minutesA) + .map(([category, minutes]) => ( + + {category} + + {Math.floor(minutes / 60)}:{Math.round(minutes % 60).toString().padStart(2, '0')}h (={Math.round(minutes)} min) + + + {total > 0 ? Math.round((minutes / total) * 1000) / 10 : 0}% + + + {total > 0 ? Math.round((minutes / (daysToFetch * 24 * 60)) * 1000) / 10 : 0}% + + + )) + }