"use client" import React, { useMemo } from "react" import { Label, PolarGrid, PolarRadiusAxis, RadialBar, RadialBarChart, } from "recharts" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card" import { ChartConfig, ChartContainer } from "@/components/ui/chart" export const KnobChart = React.memo(function KnobChart({ title, description, percentage, label, footerText }: { title: string description: string percentage: number label?: string footerText?: string }) { const { chartData, chartConfig } = useMemo(() => { return { chartData: [ { name: "value", value: percentage, fill: "hsl(var(--primary))", }, ], chartConfig: { value: { label: label || "Value", }, } satisfies ChartConfig, } }, [percentage, label]) return ( {title} {description} {footerText && (
{footerText}
)}
) })