diff --git a/apps/start/src/components/profiles/profile-activity.tsx b/apps/start/src/components/profiles/profile-activity.tsx index a4e4a21a..f8509e1f 100644 --- a/apps/start/src/components/profiles/profile-activity.tsx +++ b/apps/start/src/components/profiles/profile-activity.tsx @@ -7,6 +7,7 @@ import { format, formatISO, isSameMonth, + isToday, startOfMonth, subMonths, } from 'date-fns'; @@ -18,15 +19,26 @@ import { WidgetTitle, } from '../overview/overview-widget'; import { Button } from '../ui/button'; +import { Tooltiper } from '../ui/tooltip'; type Props = { data: { count: number; date: string }[]; }; +function getOpacityLevel(count: number, maxCount: number): number { + if (count === 0 || maxCount === 0) return 0; + const ratio = count / maxCount; + if (ratio <= 0.25) return 0.25; + if (ratio <= 0.5) return 0.5; + if (ratio <= 0.75) return 0.75; + return 1; +} + const MonthCalendar = ({ month, data, -}: { month: Date; data: Props['data'] }) => ( + maxCount, +}: { month: Date; data: Props['data']; maxCount: number }) => (