import * as React from "react" import { cn } from "../ui/utils" interface DonutItem { name: string value: number stock?: string | number unit?: string } interface BottomStat { label: string value: string | number subLabel?: string } interface DonutChartCardProps extends React.ComponentProps<"div"> { title: string centerValue?: string | number centerUnit?: string centerLabel?: string items: DonutItem[] selectedItem?: string | null onItemSelect?: (name: string | null) => void bottomStats?: BottomStat[] bottomColumns?: number chartElement: React.ReactNode } function DonutChartCard({ title, centerValue, centerUnit, centerLabel, items, selectedItem, onItemSelect, bottomStats, bottomColumns = 4, chartElement, className, ...props }: DonutChartCardProps) { const grayColors = ["#D4D4D4", "#A8A8A8", "#8B8B8B", "#6B6B6B"] return (
{centerValue} {centerUnit && {centerUnit}}
)} {centerLabel && ({centerLabel}
)}{stat.label}
{stat.value}
{stat.subLabel && ({stat.subLabel}
)}