"use client" import * as React from "react" import { BarChart, LineChart, DonutChart, type ChartDatum, type ChartSeries, type ChartState } from "@/components/charts/charts" import { Badge } from "@/components/ui/badge" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Select } from "@/components/ui/select" import { cn } from "@/lib/utils" export type ChartCardType = "bar" | "line" | "donut" export type ChartCardFilter = { label: string value: string } export type ChartCardProps = Omit, "type"> & { title?: React.ReactNode description?: React.ReactNode type?: ChartCardType data?: ChartDatum[] series?: ChartSeries[] labels?: React.ReactNode[] state?: ChartState metric?: React.ReactNode badge?: React.ReactNode filters?: ChartCardFilter[] filterValue?: string onFilterChange?: (value: string) => void } function ChartCard({ title, description, type = "bar", data = [], series, labels, state, metric, badge, filters, filterValue, onFilterChange, className, ...props }: ChartCardProps) { return (
{title ? {title} : null} {description ? {description} : null} {metric ?
{metric}
: null}
{badge ?? } {filters?.length ? (