import type { LucideIcon } from "lucide-react" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { motion } from "framer-motion" import Link from "next/link" 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 } export default function OrderStats({ title, value, icon: Icon, index = 0, filterStatus, href }: OrderStatsProps) { const linkHref = href || (filterStatus ? `/dashboard/orders?status=${filterStatus}` : undefined) const CardWrapper = linkHref ? Link : "div" const wrapperProps = linkHref ? { href: linkHref } : {} return (
{title}
{value}
{linkHref && (
Click to view →
)} ) }