"use client" import { FileText, FileSearch, Receipt, ShoppingCart } from "lucide-react" import { Card, CardContent, CardHeader, CardTitle } from "@/shared/components/ui/card" import type { DashboardData } from "./use-dashboard-data" type Props = { data: DashboardData } export function SalesPurchaseCards({ data }: Props) { const sales = data.sales_totals const purchase = data.purchase_totals const salesStats = [ { label: "Inspections", value: sales?.inspections ?? 0, icon: FileSearch }, { label: "Estimates", value: sales?.estimates ?? 0, icon: FileText }, { label: "Invoices", value: sales?.invoices ?? 0, icon: Receipt }, ] const purchaseStats = [ { label: "Purchase Orders", value: purchase?.purchase_orders ?? 0, icon: ShoppingCart }, { label: "Bills", value: purchase?.bills ?? 0, icon: Receipt }, { label: "Expenses", value: purchase?.expenses ?? 0, icon: FileText }, ] return (
Sales Documents {sales?.total_sales_documents ?? 0}
{salesStats.map((stat) => (
{stat.value} {stat.label}
))}
Purchase Documents {purchase?.total_purchase_documents ?? 0}
{purchaseStats.map((stat) => (
{stat.value} {stat.label}
))}
) }