- {/* Icon - inline with first 2 lines */}
-
-
- {/* Line 2: Order Number (big) */}
- #{order.number}
-
-
-
- {/* Line 1: Date (small) */}
-
- {formatRelativeOrDate(order.date_ts)}
-
-
-
-
- {/* Content - 2 lines inline with icon */}
-
- {/* Line 3: Customer */}
-
- {order.customer || __('Guest')}
-
-
- {/* Line 4: Items */}
- {order.items_brief && (
-
- {order.items_count} {order.items_count === 1 ? __('item') : __('items')} · {order.items_brief}
-
- )}
-
- {/* Line 5: Total & Status */}
-
-
- {formatMoney(order.total, {
- currency: order.currency || currencyConfig.currency,
- symbol: order.currency_symbol || currencyConfig.symbol,
- thousandSep: currencyConfig.thousand_sep,
- decimalSep: currencyConfig.decimal_sep,
- position: currencyConfig.position,
- decimals: currencyConfig.decimals,
- })}
-
-
-
+ {/* Order ID Badge with Status Color */}
+
+ #{order.number}
+ {/* Content */}
+
+ {/* Line 1: Date (small) */}
+
+ {formatRelativeOrDate(order.date_ts)}
+
+
+ {/* Line 2: Customer */}
+
+ {order.customer || __('Guest')}
+
+
+ {/* Line 3: Items */}
+ {order.items_brief && (
+
+ {order.items_count} {order.items_count === 1 ? __('item') : __('items')} · {order.items_brief}
+
+ )}
+
+ {/* Line 4: Total */}
+
+ {formatMoney(order.total, {
+ currency: order.currency || currencyConfig.currency,
+ symbol: order.currency_symbol || currencyConfig.symbol,
+ thousandSep: currencyConfig.thousand_sep,
+ decimalSep: currencyConfig.decimal_sep,
+ position: currencyConfig.position,
+ decimals: currencyConfig.decimals,
+ })}
+
+
{/* Chevron */}
diff --git a/admin-spa/src/routes/Orders/index.tsx b/admin-spa/src/routes/Orders/index.tsx
index e845217..fd84e59 100644
--- a/admin-spa/src/routes/Orders/index.tsx
+++ b/admin-spa/src/routes/Orders/index.tsx
@@ -133,16 +133,17 @@ export default function Orders() {
// Filter orders by search query
const filteredOrders = React.useMemo(() => {
- if (!data?.rows) return [];
- if (!searchQuery.trim()) return data.rows;
-
+ const rows = data?.rows;
+ if (!rows) return [];
+ if (!searchQuery.trim()) return rows;
+
const query = searchQuery.toLowerCase();
- return data.rows.filter(order =>
+ return rows.filter((order: any) =>
order.number?.toString().includes(query) ||
order.customer?.toLowerCase().includes(query) ||
order.status?.toLowerCase().includes(query)
);
- }, [data?.rows, searchQuery]);
+ }, [data, searchQuery]);
// Count active filters
const activeFiltersCount = React.useMemo(() => {