| "use client"; | |
| import { | |
| Bar, | |
| BarChart, | |
| CartesianGrid, | |
| ResponsiveContainer, | |
| Tooltip, | |
| XAxis, | |
| YAxis, | |
| } from "recharts"; | |
| import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; | |
| interface UsageData { | |
| name: string; | |
| value: number; | |
| } | |
| interface PlatformUsageChartProps { | |
| data: UsageData[]; | |
| } | |
| export function PlatformUsageChart({ data }: PlatformUsageChartProps) { | |
| return ( | |
| <Card> | |
| <CardHeader> | |
| <CardTitle>Platform Usage</CardTitle> | |
| <CardDescription>Key metrics for platform activity</CardDescription> | |
| </CardHeader> | |
| <CardContent className="h-[300px]"> | |
| <ResponsiveContainer width="100%" height="100%"> | |
| <BarChart data={data}> | |
| <XAxis | |
| dataKey="name" | |
| stroke="#888888" | |
| fontSize={12} | |
| tickLine={false} | |
| axisLine={false} | |
| /> | |
| <YAxis | |
| stroke="#888888" | |
| fontSize={12} | |
| tickLine={false} | |
| axisLine={false} | |
| tickFormatter={(value) => `${value}`} | |
| /> | |
| <Tooltip | |
| cursor={{ fill: "transparent" }} | |
| contentStyle={{ | |
| backgroundColor: "hsl(var(--background))", | |
| borderColor: "hsl(var(--border))", | |
| borderRadius: "var(--radius)", | |
| }} | |
| /> | |
| <Bar | |
| dataKey="value" | |
| fill="hsl(var(--primary))" | |
| radius={[4, 4, 0, 0]} | |
| /> | |
| </BarChart> | |
| </ResponsiveContainer> | |
| </CardContent> | |
| </Card> | |
| ); | |
| } | |