diff --git a/frontend/src/components/MemberDetailModal.tsx b/frontend/src/components/MemberDetailModal.tsx
index 0275030..7eb02c7 100644
--- a/frontend/src/components/MemberDetailModal.tsx
+++ b/frontend/src/components/MemberDetailModal.tsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useState } from "react";
+import React, { useEffect, useRef, useState } from "react";
import { AnimatePresence, motion } from "framer-motion";
import { X, Mail, Clock, CheckCircle2, Loader2, AlertCircle, TrendingUp, Zap } from "lucide-react";
import { format, differenceInDays } from "date-fns";
@@ -27,6 +27,24 @@ function getPeriodLabel(s: PeriodStats, groupedBy: "DAY" | "MONTH"): string {
return `${MONTH_NAMES[s.month - 1]}/${String(s.year).slice(2)}`;
}
+interface TooltipState { x: number; y: number; content: string }
+
+function ChartTooltip({ tooltip }: { tooltip: TooltipState }) {
+ const above = tooltip.y > 40;
+ return (
+
+ {tooltip.content}
+
+ );
+}
+
function Avatar({ name, photo }: { name: string; photo?: string | null }) {
if (photo) return
;
const initials = name.split(" ").slice(0, 2).map((n) => n[0]).join("").toUpperCase();
@@ -42,12 +60,23 @@ function BarChart({
valueKey,
color,
groupedBy,
+ formatValue,
}: {
data: PeriodStats[];
valueKey: "finishedTasksCount" | "totalMinutesWorked";
color: string;
groupedBy: "DAY" | "MONTH";
+ formatValue: (v: number) => string;
}) {
+ const [tooltip, setTooltip] = useState(null);
+ const svgRef = useRef(null);
+
+ const handleMouseMove = (e: React.MouseEvent, content: string) => {
+ const rect = svgRef.current?.getBoundingClientRect();
+ if (!rect) return;
+ setTooltip({ x: e.clientX - rect.left, y: e.clientY - rect.top, content });
+ };
+
const values = data.map((d) => d[valueKey] as number);
const maxVal = Math.max(...values, 1);
const chartW = 220;
@@ -62,30 +91,74 @@ function BarChart({
};
return (
-