+ {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"}
@@ -282,12 +284,12 @@ function DashboardTab({ stats, recentOrders, brandId, onMsg, webhookActivity }:
{/* Recent webhook activity */}
{webhookActivity.length > 0 && (
-
-
Recent Webhook Activity
+
+
Recent Webhook Activity
-
+
Event
Order
Status
@@ -295,25 +297,25 @@ function DashboardTab({ stats, recentOrders, brandId, onMsg, webhookActivity }:
Sent At
-
+
{webhookActivity.map((entry) => (
-
+
- {entry.event_type}
+ {entry.event_type}
- {entry.order_id ? entry.order_id.slice(0, 8) : "—"}
+ {entry.order_id ? entry.order_id.slice(0, 8) : "—"}
{entry.status}
- {entry.attempts}
- {new Date(entry.created_at).toLocaleString()}
+ {entry.attempts}
+ {new Date(entry.created_at).toLocaleString()}
))}
@@ -519,31 +521,41 @@ function CustomersTab({ customers, products, brandId, onMsg, registrations = [],
{/* Sub-tab nav */}
-
setSubTab("customers")}
- className={`px-3 py-1.5 text-sm font-medium rounded-lg ${subTab === "customers" ? "bg-green-100 text-green-400" : "bg-zinc-950 text-zinc-400"}`}>
+ setSubTab("customers")}
+ >
Customers ({customers.filter(c => c.account_status !== "pending_approval" && c.account_status !== "rejected").length})
-
-
setSubTab("registrations")}
- className={`px-3 py-1.5 text-sm font-medium rounded-lg ${subTab === "registrations" ? "bg-green-100 text-green-400" : "bg-zinc-950 text-zinc-400"}`}>
+
+ setSubTab("registrations")}
+ >
Registrations ({registrations.filter(r => r.account_status === "pending_approval").length})
-
+
{subTab === "customers" && (
-
+
+ Add Customer
-
+
)}
{subTab === "registrations" && (
-
Pending Registrations
+
Pending Registrations
{registrations.filter(r => r.account_status === "pending_approval").length === 0 ? (
-
No pending registrations.
+
No pending registrations.
) : (
-
+
-
+
Company
Contact
@@ -552,27 +564,34 @@ function CustomersTab({ customers, products, brandId, onMsg, registrations = [],
-
+
{registrations.filter(r => r.account_status === "pending_approval").map(r => (
-
- {r.company_name ?? "—"}
- {r.contact_name ?? "—"}{r.email}
+
+ {r.company_name ?? "—"}
+ {r.contact_name ?? "—"}{r.email}
- Pending
+ Pending
- {formatDate(new Date(r.created_at))}
+ {formatDate(new Date(r.created_at))}
-
handleApproveReject(r.id, "approve")}
+ handleApproveReject(r.id, "approve")}
disabled={processingReg === r.id}
- className="rounded-lg bg-green-600 px-3 py-1 text-xs font-semibold text-white hover:bg-green-700 disabled:opacity-50">
+ isLoading={processingReg === r.id}
+ >
{processingReg === r.id ? "..." : "Approve"}
-
-
handleApproveReject(r.id, "reject")}
+
+ handleApproveReject(r.id, "reject")}
disabled={processingReg === r.id}
- className="rounded-lg bg-red-900/300 px-3 py-1 text-xs font-semibold text-white hover:bg-red-600 disabled:opacity-50">
+ >
Reject
-
+
@@ -587,33 +606,33 @@ function CustomersTab({ customers, products, brandId, onMsg, registrations = [],
{subTab === "customers" && (
<>
{showForm && (
-
-
{editing ? "Edit Customer" : "New Customer"}
+
+
{editing ? "Edit Customer" : "New Customer"}
- Company Name
+ Company Name
setForm(f => ({ ...f, companyName: e.target.value }))}
- className="w-full rounded-xl border border-zinc-600 px-3 py-2 text-sm outline-none focus:border-slate-900" />
+ className="w-full rounded-xl border border-[var(--admin-border)] px-3 py-2 text-sm outline-none focus:border-[var(--admin-accent)]" />
- Contact Name
+ Contact Name
setForm(f => ({ ...f, contactName: e.target.value }))}
- className="w-full rounded-xl border border-zinc-600 px-3 py-2 text-sm outline-none focus:border-slate-900" />
+ className="w-full rounded-xl border border-[var(--admin-border)] px-3 py-2 text-sm outline-none focus:border-[var(--admin-accent)]" />
- Email
+ Email
setForm(f => ({ ...f, email: e.target.value }))}
- className="w-full rounded-xl border border-zinc-600 px-3 py-2 text-sm outline-none focus:border-slate-900" />
+ className="w-full rounded-xl border border-[var(--admin-border)] px-3 py-2 text-sm outline-none focus:border-[var(--admin-accent)]" />
- Phone
+ Phone
setForm(f => ({ ...f, phone: e.target.value }))}
- className="w-full rounded-xl border border-zinc-600 px-3 py-2 text-sm outline-none focus:border-slate-900" />
+ className="w-full rounded-xl border border-[var(--admin-border)] px-3 py-2 text-sm outline-none focus:border-[var(--admin-accent)]" />
- Status
+ Status
setForm(f => ({ ...f, accountStatus: e.target.value }))}
- className="w-full rounded-xl border border-zinc-600 px-3 py-2 text-sm outline-none focus:border-slate-900">
+ className="w-full rounded-xl border border-[var(--admin-border)] px-3 py-2 text-sm outline-none focus:border-[var(--admin-accent)]">
Active
On Hold
Disabled
@@ -621,55 +640,53 @@ function CustomersTab({ customers, products, brandId, onMsg, registrations = [],
- Credit Limit ($)
+ Credit Limit ($)
setForm(f => ({ ...f, creditLimit: Number(e.target.value) }))}
- className="w-full rounded-xl border border-zinc-600 px-3 py-2 text-sm outline-none focus:border-slate-900" placeholder="0 = unlimited" />
+ className="w-full rounded-xl border border-[var(--admin-border)] px-3 py-2 text-sm outline-none focus:border-[var(--admin-accent)]" placeholder="0 = unlimited" />
-
-
Deposit Rules
+
+
Deposit Rules
setForm(f => ({ ...f, depositsEnabled: e.target.checked }))}
className="rounded" id="dep-enabled" />
- Enable deposit requirement
+ Enable deposit requirement
{form.depositsEnabled && (
)}
-
+
{saving ? "Saving..." : "Save Customer"}
-
-
setShowForm(false)}
- className="rounded-xl border border-zinc-600 px-5 py-2 text-sm font-medium text-zinc-300 hover:bg-zinc-800">
+
+ setShowForm(false)} variant="secondary">
Cancel
-
+
)}
-
+
-
+
- 0}
onChange={toggleAllCustomers}
/>
@@ -683,38 +700,37 @@ function CustomersTab({ customers, products, brandId, onMsg, registrations = [],
-
+
{customers.length === 0 ? (
- No customers yet.
+ No customers yet.
) : customers.map(c => (
-
+
- toggleSelectCustomer(c.id)}
/>
- {c.company_name ?? "—"}
- {c.contact_name ?? "—"}{c.email}
+ {c.company_name ?? "—"}
+ {c.contact_name ?? "—"}{c.email}
- {c.account_status}
+
+ {c.account_status}
+
-
+
{c.credit_limit <= 0 ? "Unlimited" : `$${Number(c.credit_limit).toFixed(2)}`}
-
+
{c.deposits_enabled ? `${c.deposit_percentage}%` : "—"}
- {formatDate(new Date(c.created_at))}
+ {formatDate(new Date(c.created_at))}
openPriceSheetModal([c.id])}
title="Send price sheet"
- className="inline-flex items-center justify-center rounded-xl w-9 h-9 text-blue-600 hover:text-blue-800 hover:bg-blue-50 transition-colors"
+ className="inline-flex items-center justify-center rounded-xl w-9 h-9 text-[var(--admin-accent)] hover:text-[var(--admin-accent-text)] hover:bg-[var(--admin-accent-light)] transition-colors"
>
@@ -722,45 +738,45 @@ function CustomersTab({ customers, products, brandId, onMsg, registrations = [],
toggleCustomerActions(c.id, e)}
title="More actions"
- className="inline-flex items-center justify-center rounded-xl w-9 h-9 text-slate-400 hover:text-zinc-300 hover:bg-zinc-950 transition-colors"
+ className="inline-flex items-center justify-center rounded-xl w-9 h-9 text-[var(--admin-text-muted)] hover:text-[var(--admin-text-secondary)] hover:bg-[var(--admin-bg-subtle)] transition-colors"
>
{openCustomerActions === c.id && (
e.stopPropagation()}
>
{ setOpenCustomerActions(null); openEdit(c); }}
- className="w-full text-left px-4 py-3 text-green-400 hover:bg-green-900/30 flex items-center gap-3 font-medium"
+ className="w-full text-left px-4 py-3 text-[var(--admin-accent)] hover:bg-[var(--admin-accent-light)] flex items-center gap-3 font-medium"
>
-
+
Edit Customer
{ setOpenCustomerActions(null); setPricingCustomer(c); }}
- className="w-full text-left px-4 py-3 text-zinc-300 hover:bg-zinc-800 flex items-center gap-3"
+ className="w-full text-left px-4 py-3 text-[var(--admin-text-secondary)] hover:bg-[var(--admin-bg-subtle)] flex items-center gap-3"
>
-
+
Pricing
-
+
View Portal As
-
+
{ setOpenCustomerActions(null); handleDeleteCustomer(c.id); }}
disabled={deletingCustomer === c.id}
- className="w-full text-left px-4 py-3 text-red-500 hover:bg-red-900/30 flex items-center gap-3 disabled:opacity-50"
+ className="w-full text-left px-4 py-3 text-[var(--admin-danger)] hover:bg-[var(--admin-danger-light)] flex items-center gap-3 disabled:opacity-50"
>
-
+
{deletingCustomer === c.id ? "Deleting..." : "Delete Customer"}
@@ -772,14 +788,19 @@ function CustomersTab({ customers, products, brandId, onMsg, registrations = [],
))}
{selectedCustomers.size > 0 && (
-
+
- {selectedCustomers.size} selected
- openPriceSheetModal(Array.from(selectedCustomers))} disabled={sendingPriceSheet}
- className="rounded-lg bg-blue-600 text-white px-4 py-1.5 text-sm font-medium hover:bg-blue-700 disabled:opacity-50">
+ {selectedCustomers.size} selected
+ openPriceSheetModal(Array.from(selectedCustomers))}
+ disabled={sendingPriceSheet}
+ variant="primary"
+ size="sm"
+ isLoading={sendingPriceSheet}
+ >
{sendingPriceSheet ? "Sending..." : `Send Price Sheet to ${selectedCustomers.size} Customer(s)`}
-
+
@@ -789,7 +810,7 @@ function CustomersTab({ customers, products, brandId, onMsg, registrations = [],
>
)}
- {/* Customer Pricing Overrides Panel */}
+ {/* Customer Pricing Overlays Panel */}
{pricingCustomer && (
-
-
+
+
-
Pricing Overrides
-
{customer.company_name}
+
Pricing Overrides
+
{customer.company_name}
-
+
@@ -862,30 +883,30 @@ function CustomerPricingPanel({ customer, products, onClose, onMsg }: {
{loading ? (
-
Loading...
+
Loading...
) : products.length === 0 ? (
-
No products available.
+
No products available.
) : (
)}
-
+
Leave override price blank to remove custom pricing and use standard price tiers.
@@ -950,15 +972,15 @@ function PriceSheetModal({
return (
-
e.stopPropagation()}>
-
+
e.stopPropagation()}>
+
-
Send Price Sheet
-
+
Send Price Sheet
+
{customerCount === 1 ? "1 customer" : `${customerCount} customers`}
-
+
@@ -966,44 +988,42 @@ function PriceSheetModal({