import * as React from "react"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "@/lib/utils"; const valueAccent = cva("text-3xl font-bold leading-none", { variants: { accent: { foreground: "text-[hsl(var(--foreground))]", primary: "text-[hsl(var(--primary))]", success: "text-[hsl(var(--success))]", warning: "text-[hsl(var(--warning))]", danger: "text-[hsl(var(--danger))]", purple: "text-[hsl(var(--purple))]", }, }, defaultVariants: { accent: "foreground", }, }); interface StatCardProps extends Omit, "title">, VariantProps { title: React.ReactNode; value: React.ReactNode; sub?: React.ReactNode; icon?: React.ReactNode; } export function StatCard({ title, value, sub, icon, accent, className, ...props }: StatCardProps) { return (
{icon ? ( {icon} ) : null} {title}
{value}
{sub ? (
{sub}
) : null}
); }