import type { LucideIcon } from "lucide-react" import { Card, CardContent, CardHeader, CardTitle } from "@/components/common/card" import { motion } from "framer-motion" import Link from "next/link" import { ResponsiveContainer, LineChart, Line } from "recharts" interface OrderStatsProps { title: string value: string icon: LucideIcon index?: number /** Status to filter by when clicking (e.g., "paid", "shipped") */ filterStatus?: string /** Custom href if not using filterStatus */ href?: string /** Data for sparkline [ { value: number }, ... ] */ trendData?: { value: number }[] /** Color for the sparkline */ trendColor?: string } export default function OrderStats({ title, value, icon: Icon, index = 0, filterStatus, href, trendData, trendColor = "#8884d8" }: OrderStatsProps) { const linkHref = href || (filterStatus ? `/dashboard/orders?status=${filterStatus}` : undefined) const CardWrapper = linkHref ? Link : "div" const wrapperProps = linkHref ? { href: linkHref } : {} return (
{title}
{value}
{trendData && trendData.length > 0 && (
)}
{linkHref && (
Click to view →
)} ) }