diff --git a/src/app/admin/orders/[id]/page.tsx b/src/app/admin/orders/[id]/page.tsx index c0f2149..cfe0e27 100644 --- a/src/app/admin/orders/[id]/page.tsx +++ b/src/app/admin/orders/[id]/page.tsx @@ -4,6 +4,8 @@ import OrderEditForm from "@/components/admin/OrderEditForm"; import OrderPaymentSection from "@/components/admin/OrderPaymentSection"; import OrderPickupAction from "@/components/admin/OrderPickupAction"; import AdminAccessDenied from "@/components/admin/AdminAccessDenied"; +import AdminBadge from "@/components/admin/design-system/AdminBadge"; +import { PageHeader } from "@/components/admin/design-system"; import { formatDate } from "@/lib/format-date"; import { redirect } from "next/navigation"; import Link from "next/link"; @@ -34,16 +36,31 @@ export default async function OrderDetailPage({ params }: OrderDetailPageProps) if (!order) { return ( -
+
← Back to Orders -
-

Order not found

+
+

+ Order not found +

@@ -67,46 +84,66 @@ export default async function OrderDetailPage({ params }: OrderDetailPageProps) const total = subtotal + taxAmount - discount_amount; return ( -
+
+ {/* Back link */} + + + + + Back to Orders + + {/* Header */} -
-
- - - - - -
-

Order Details

-

{formatDate(order.created_at)}

-
-
-
- - {order.pickup_complete ? "✓ Picked Up" : "⏳ Pending"} - - {order.payment_processor && ( - - {order.payment_processor} - - )} -
+
+

+ Order #{order.id.slice(0, 8).toUpperCase()} · {formatDate(order.created_at)} +

+ + + {order.pickup_complete ? "Picked Up" : "Pending"} + + {order.payment_processor && ( + {order.payment_processor} + )} +
+ } + />
{/* Customer info */} -
+
-

Customer

-

{order.customer_name}

+

+ Customer +

+

+ {order.customer_name} +

{order.customer_phone && (
-

Phone

-

{order.customer_phone}

+

+ Phone +

+

+ {order.customer_phone} +

)} {order.customer_email && (
-

Email

-

{order.customer_email}

+

+ Email +

+

+ {order.customer_email} +

)}
@@ -133,64 +190,133 @@ export default async function OrderDetailPage({ params }: OrderDetailPageProps) {/* Stop info */} {order.stops && ( -
-

Pickup Location

-

+

+

+ Pickup Location +

+

{order.stops.city}, {order.stops.state}

-

{formatDate(order.stops.date)}

+

+ {formatDate(order.stops.date)} +

)} {/* Order items */} -
-

Order Items

+
+

+ Order Items +

{order.order_items && order.order_items.length > 0 ? ( -
+
{order.order_items.map((item: OrderItem) => (
-

+

{item.products?.name ?? "Unknown Product"}

-

Qty: {item.quantity} × {formatCurrency(Number(item.price))}

+

+ Qty: {item.quantity} × {formatCurrency(Number(item.price))} +

-

+

{formatCurrency(Number(item.price) * item.quantity)}

))}
) : ( -

No items found

+

+ No items found +

)} {/* Totals */} -
+
- Subtotal - {formatCurrency(subtotal)} + Subtotal + + {formatCurrency(subtotal)} +
{taxAmount > 0 && (
- Tax - {formatCurrency(taxAmount)} + Tax + + {formatCurrency(taxAmount)} +
)} {discount_amount > 0 && (
- Discount - -{formatCurrency(discount_amount)} + Discount + + -{formatCurrency(discount_amount)} + {order.discount_reason && ( - ({order.discount_reason}) + + ({order.discount_reason}) + )}
)} -
+
Total {formatCurrency(total)}
@@ -198,9 +324,25 @@ export default async function OrderDetailPage({ params }: OrderDetailPageProps)
{/* Payment & Refunds */} -
-

Payment & Refunds

-

Record payment details and manage refunds

+
+

+ Payment & Refunds +

+

+ Record payment details and manage refunds +

{/* Edit form */} -
-

Edit Order

-

Update customer details, pricing, and status

+
+

+ Edit Order +

+

+ Update customer details, pricing, and status +

[0]["order"]} brandId={brandId} /> @@ -229,12 +387,28 @@ export default async function OrderDetailPage({ params }: OrderDetailPageProps) {/* Internal notes */} {order.internal_notes && ( -
-

Internal Notes

-

{order.internal_notes}

+
+

+ Internal Notes +

+

+ {order.internal_notes} +

)}
); -} \ No newline at end of file +} diff --git a/src/app/admin/orders/page.tsx b/src/app/admin/orders/page.tsx index c37ddc1..cd3460f 100644 --- a/src/app/admin/orders/page.tsx +++ b/src/app/admin/orders/page.tsx @@ -65,11 +65,12 @@ export default async function AdminOrdersPage() { } return ( -
+
+

Operations

@@ -82,7 +83,13 @@ export default async function AdminOrdersPage() { {/* Content */}
-
+
( - - - - - ), - check: (className: string) => ( - - - - ), - x: (className: string) => ( - - - - - ), - chevronDown: (className: string) => ( - - - - ), - chevronLeft: (className: string) => ( - - - - ), - chevronRight: (className: string) => ( - - - - ), - package: (className: string) => ( - - - - - - - ), - selectAll: (className: string) => ( - - - - - ), -}; +// Icon wrappers (lucide-react) — kept compact for inline use. +const MapPinIcon = () => ; +const CheckIcon = () => ; +const XIcon = () => ; +const ChevronDownIcon = () => ; +const ChevronLeftIcon = () => ; +const ChevronRightIcon = () => ; export default function AdminOrdersPanel({ initialOrders, @@ -318,11 +296,11 @@ export default function AdminOrdersPanel({ async function handleBulkMarkPickup() { if (selectedOrders.size === 0) return; - + setBulkMarkingUp(true); let successCount = 0; let failCount = 0; - + for (const orderId of selectedOrders) { const result = await markPickupComplete(orderId, brandId); if (result.success) { @@ -338,10 +316,10 @@ export default function AdminOrdersPanel({ failCount++; } } - + setBulkMarkingUp(false); setSelectedOrders(new Set()); - + if (failCount === 0) { showSuccess(`${successCount} order${successCount !== 1 ? 's' : ''} marked as picked up`); } else { @@ -355,12 +333,23 @@ export default function AdminOrdersPanel({ {/* Header */}
-
- {Icons.package("h-5 w-5 text-white")} +
+
-

Orders

-

+

+ Orders +

+

{filteredOrders.length} order{filteredOrders.length !== 1 ? "s" : ""}

@@ -368,7 +357,7 @@ export default function AdminOrdersPanel({
{brandId && ( - Brand scoped + Brand scoped )} -
-

Total

-

{isLoading ? : orders.length}

-
-
-

Pending

-

{isLoading ? : pendingCount}

-
-
-

Picked Up

-

{isLoading ? : pickedUpCount}

-
+ : orders.length} + tone="default" + /> + : pendingCount} + tone="warning" + /> + : pickedUpCount} + tone="primary" + />
{/* Filters */} @@ -423,40 +415,92 @@ export default function AdminOrdersPanel({
{showStopDropdown && ( <>
setShowStopDropdown(false)} /> -
-
- Filter by Stop - +
+
+ + Filter by Stop + +
{stops.map((stop) => ( -