"use client"; import React from "react"; import { Activity, Flame, Calendar } from "lucide-react"; interface ActivityHeatmapProps { title?: string; subtitle?: string; data?: Array<{ date?: string; month?: string; count: number; level?: number }>; className?: string; } // Generate 12 months of activity data const generateMonthlyData = () => { const months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ]; return months.map((month, i) => ({ month, count: Math.floor(Math.random() * 100) + 20, level: Math.floor(Math.random() * 4), // 0-3 intensity })); }; const LEVEL_COLORS = [ "var(--border-color-subtle)", // level 0 - no activity "rgba(255, 159, 10, 0.15)", // level 1 - light "rgba(255, 159, 10, 0.4)", // level 2 - medium "var(--color-primary)", // level 3 - heavy ]; export function ActivityHeatmap({ title = "Activity Overview", subtitle = "Activity over the last 12 months", data, className, }: ActivityHeatmapProps) { const heatmapData = data || generateMonthlyData(); const maxCount = Math.max(...heatmapData.map((d) => d.count), 1); return (
{title}
{subtitle}