import * as React from "react" import { cn } from "../ui/utils" interface ChartStat { label: string value: string | number unit?: string } interface ChartCardProps extends React.ComponentProps<"div"> { title?: string headerLeft?: React.ReactNode periods?: string[] activePeriod?: string onPeriodChange?: (period: string) => void stats?: ChartStat[] statsColumns?: number } function ChartCard({ title, headerLeft, periods, activePeriod, onPeriodChange, stats, statsColumns = 3, className, children, ...props }: ChartCardProps) { return (
{title && (

{title}

)} {headerLeft}
{periods && (
{periods.map((period) => ( ))}
)}
{children}
{stats && stats.length > 0 && (
{stats.map((stat) => (

{stat.label}

{stat.value} {stat.unit && {stat.unit}}

))}
)}
) } export { ChartCard } export type { ChartCardProps, ChartStat }