"use client" import { Bar, BarChart, LabelList, XAxis, YAxis, Cell } from "recharts" import { cn } from "@/lib/utils" import { ChartContainer, type ChartConfig } from "@/components/ui/chart" const COLORS = ["#4ade80", "#60a5fa", "#f87171", "#fb923c", "#c084fc"] const chartConfig = { total_seconds: { label: "Seconds", }, } satisfies ChartConfig type ChartData = { language: string total_seconds: number label: string } interface MyBarChartProps { data: ChartData[] className?: string } interface MyBarChartStateProps { className?: string bars?: number } export function MyBarChart({ data, className }: MyBarChartProps) { return ( {data.map((_, index) => ( ))} ( {String(value)} )} /> ) } export function MyBarChartSkeleton({ className, bars = 5 }: MyBarChartStateProps) { const fakeData = Array.from({ length: bars }).map((_, i) => ({ language: String.fromCharCode(97 + i), total_seconds: 100000 - i * 15000, })) return ( ) } export function MyBarChartError({ className, bars = 5 }: MyBarChartStateProps) { const fakeData = Array.from({ length: bars }).map((_, i) => ({ language: String.fromCharCode(97 + i), total_seconds: 100000 - i * 15000, })) return (
Failed to fetch Wakatime stats :/
) }