mirror of
https://github.com/soconnor0919/beenvoice.git
synced 2025-12-11 08:34:43 -05:00
Bump Next.js from 15.4.5 to 15.5.6 and update related dependencies. Also upgrade other packages to latest compatible versions including: - Radix UI components (all minor version updates) - Tiptap editor (3.0.7 → 3.11.0) - React and React DOM (19.1.1 → 19.2.0) - TanStack Query (5.84.0 → 5.90.10) - TypeScript and ESLint ecosystem - Tailwind CSS (4.1.11 → 4.1.17) - Various other patch and minor updates Additionally add theme support with next-themes and multiple color schemes (light, dark, sunset, forest).
85 lines
2.0 KiB
TypeScript
85 lines
2.0 KiB
TypeScript
"use client";
|
|
|
|
import {
|
|
TrendingDown,
|
|
TrendingUp,
|
|
DollarSign,
|
|
Clock,
|
|
Users,
|
|
} from "lucide-react";
|
|
import { Card, CardContent } from "~/components/ui/card";
|
|
|
|
type IconName = "DollarSign" | "Clock" | "Users" | "TrendingDown";
|
|
|
|
interface AnimatedStatsCardProps {
|
|
title: string;
|
|
value: string;
|
|
change: string;
|
|
trend: "up" | "down";
|
|
iconName: IconName;
|
|
description: string;
|
|
delay?: number;
|
|
isCurrency?: boolean;
|
|
numericValue?: number;
|
|
}
|
|
|
|
const iconMap = {
|
|
DollarSign,
|
|
Clock,
|
|
Users,
|
|
TrendingDown,
|
|
} as const;
|
|
|
|
export function AnimatedStatsCard({
|
|
title,
|
|
value,
|
|
change,
|
|
trend,
|
|
iconName,
|
|
description,
|
|
delay = 0,
|
|
isCurrency = false,
|
|
numericValue,
|
|
}: AnimatedStatsCardProps) {
|
|
const Icon = iconMap[iconName];
|
|
const TrendIcon = trend === "up" ? TrendingUp : TrendingDown;
|
|
const isPositive = trend === "up";
|
|
|
|
// For now, always use the formatted value prop to ensure correct display
|
|
// Animation can be added back once the basic display is working correctly
|
|
const displayValue = value;
|
|
|
|
// Suppress unused parameter warnings for now
|
|
void delay;
|
|
void isCurrency;
|
|
void numericValue;
|
|
|
|
return (
|
|
<Card>
|
|
<CardContent className="p-6">
|
|
<div className="flex items-center justify-between space-y-0 pb-2">
|
|
<div className="flex items-center space-x-2">
|
|
<Icon className="text-muted-foreground h-5 w-5" />
|
|
<p className="text-muted-foreground text-sm font-medium">{title}</p>
|
|
</div>
|
|
<div
|
|
className="flex items-center space-x-1 text-xs"
|
|
style={{
|
|
color: isPositive
|
|
? "oklch(var(--chart-2))"
|
|
: "oklch(var(--chart-3))",
|
|
}}
|
|
>
|
|
<TrendIcon className="h-3 w-3" />
|
|
<span>{change}</span>
|
|
</div>
|
|
</div>
|
|
<div className="space-y-1">
|
|
<p className="animate-count-up text-2xl font-bold">{displayValue}</p>
|
|
<p className="text-muted-foreground text-xs">{description}</p>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
);
|
|
}
|