+ {/* Card header */}
+
+
+
+ {order.online_order_ref ?? `#${order.id}`}
+
+
+ {isDelivery ? 'Delivery' : 'Dine-in'}
+
+
+
+
{timeAgo(order.opened_at)}
+
+
+ {/* Customer info */}
+
+ {order.online_customer_name && (
+
{order.online_customer_name}
+ )}
+ {order.online_customer_phone && (
+
{order.online_customer_phone}
+ )}
+ {isDelivery && order.online_customer_address && (
+
{order.online_customer_address}
+ )}
+ {order.online_customer_notes && (
+
+ 📝 {order.online_customer_notes}
+
+ )}
+
+
+ {/* Items */}
+
+
+ {order.items.map((it, i) => (
+
+ {it.quantity} × {it.product?.name ?? `#${it.product_id}`}
+ €{(it.unit_price * it.quantity).toFixed(2)}
+
+ ))}
+
+
+ Σύνολο
+ €{subtotal.toFixed(2)}
+
+
+
+ {/* Actions */}
+
+ {st === 'pending_acceptance' && (
+ <>
+
+
+ >
+ )}
+ {st === 'accepted' && (
+
+ )}
+ {st === 'preparing' && (
+ isDelivery ? (
+
+ ) : (
+
+ )
+ )}
+ {(st === 'ready' || st === 'out_for_delivery') && (
+
+ )}
+
+
+ {/* Reject inline form */}
+ {rejectOpen && (
+
+ )}
+
+ )
+}
+
+// ── Tab Panel ─────────────────────────────────────────────────────────────────
+
+function OrderList({ orders, onAction, emptyText }) {
+ if (!orders.length) {
+ return
+ {/* Page header */}
+
+
Online Παραγγελίες
+ {pendingCount > 0 && (
+
+ {pendingCount}
+
+ )}
+
+
+
+ {/* Tabs */}
+
+ {TABS.map(tab => {
+ const count = tab.key === 'incoming' ? incoming.length
+ : tab.key === 'active' ? active.length
+ : history.length
+ const isActive = activeTab === tab.key
+ return (
+
+ )
+ })}
+
+
+ {/* Content */}
+
+ {error && (
+
+ {error}
+
+ )}
+
+ {activeTab === 'incoming' && (
+
+ )}
+ {activeTab === 'active' && (
+
+ )}
+ {activeTab === 'history' && (
+
+ )}
+
+
+ )
+}