Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

Show total hours of weekly activities on dashboard

Khuram Niaz95bc04677cbc
diff --git a/src/components/dashboard/WeeklyBarChartToggle.tsx b/src/components/dashboard/WeeklyBarChartToggle.tsx
index e2a314f..e175f17 100644
--- a/src/components/dashboard/WeeklyBarChartToggle.tsx
+++ b/src/components/dashboard/WeeklyBarChartToggle.tsx
@@ -33,13 +33,34 @@ export default function WeeklyBarChartToggle({
return newItem;
});
+ const totalHours =
+ current.label === "Activities"
+ ? roundedData.reduce(
+ (sum, item) =>
+ sum +
+ current.keys.reduce(
+ (keySum, key) =>
+ keySum + (typeof item[key] === "number" ? item[key] : 0),
+ 0,
+ ),
+ 0,
+ )
+ : null;
+
return (
<Card className="mb-2 lg:mb-0">
<CardHeader className="pb-3">
<div className="flex items-center justify-between mb-1 mt-3">
- <CardTitle className="text-green-600">
- Weekly {current.label}
- </CardTitle>
+ <div className="flex items-baseline gap-2">
+ <CardTitle className="text-green-600">
+ Weekly {current.label}
+ </CardTitle>
+ {totalHours !== null && (
+ <span className="text-sm text-muted-foreground">
+ {totalHours.toFixed(1)} hrs
+ </span>
+ )}
+ </div>
<div className="flex rounded-md border text-xs">
{charts.map((chart, index) => (
<button