import * as React from "react" import { Card } from "@/components/ui/card" import { cn } from "@/lib/utils" import { ArrowUp, ArrowDown, Minus } from "lucide-react" interface StatsCardProps { icon: React.ReactNode title: string value: string | number trend?: { value: number isPositive: boolean } className?: string } /** * StatsCard component for displaying key metrics in the dashboard. * @param {React.ReactNode} icon - Icon component to display * @param {string} title - Title of the metric * @param {string|number} value - Value to display * @param {Object} trend - Optional trend information with value and isPositive flag * @param {string} className - Optional additional CSS classes */ export function StatsCard({ icon, title, value, trend, className }: StatsCardProps) { return (
{title} {value} {trend && (
{trend.value === 0 ? ( ) : trend.isPositive ? ( ) : ( )} 0 && "text-green-600", !trend.isPositive && trend.value > 0 && "text-red-600" )} > {trend.value}%
)}
{icon}
) }