import type { WholesaleOrder, WholesaleDashboardStats } from "@/actions/wholesale"; import StatusBadge from "./StatusBadge"; import type { MsgFn, WebhookActivityEntry } from "./types"; interface DashboardTabProps { stats: WholesaleDashboardStats; recentOrders: WholesaleOrder[]; webhookActivity: WebhookActivityEntry[]; } // Top-level dashboard: stat cards + recent orders table + recent webhook activity. export default function DashboardTab({ stats, recentOrders, webhookActivity }: DashboardTabProps) { return (
{card.label}
{card.value}
No wholesale orders yet
Wholesale orders placed by your customers will appear here.
| Invoice | Customer | Pickup Date | Total | Status | Payment |
|---|---|---|---|---|---|
| {order.invoice_number ?? "—"} | {order.company_name} | {order.anticipated_pickup_date ?? "—"} | ${Number(order.subtotal).toFixed(2)} |
|
{order.payment_status === "paid" ? "Paid" : order.balance_due > 0 ? `$${Number(order.balance_due).toFixed(2)} due` : "Partial"} |
| Event | Order | Status | Attempts | Sent At |
|---|---|---|---|---|
| {entry.event_type} | {entry.order_id ? entry.order_id.slice(0, 8) : "—"} | {entry.status} | {entry.attempts} | {new Date(entry.created_at).toLocaleString()} |