"use client"; import { Fragment, type ReactNode } from "react"; import classNames from "@calcom/ui/classNames"; import { Button } from "@calcom/ui/components/button"; import { Tooltip } from "@calcom/ui/components/tooltip"; type LegendItem = { label: string; color: string; // hex format }; export type LegendSize = "sm" | "default"; export function ChartCard({ title, subtitle, cta, legend, legendSize, children, }: { title: string | React.ReactNode; subtitle?: string; cta?: { label: string; onClick: () => void }; legend?: Array; legendSize?: LegendSize; children: React.ReactNode; }) { return (
{typeof title === "string" ? (

{title}

) : ( title )}
{legend && legend.length > 0 && } {cta && ( )}
{subtitle && (

{subtitle}

)} {children}
); } export function ChartCardItem({ count, className, children, }: { count?: number | string; className?: string; children: ReactNode; }) { return (
{children}
{count !== undefined &&
{count}
}
); } function Legend({ items, size = "default" }: { items: LegendItem[]; size?: LegendSize }) { return (
{items.map((item, index) => (

{item.label}

{index < items.length - 1 &&
} ))}
); }