// OrderDetail.jsx — detail view for a single order, opened from Account > Mis compras. // Timeline of states, items table, shipping address, payment summary, invoice. const ORDER_DETAIL_DATA = { "AL-712304": { id: "AL-712304", date: "12 feb 2026 · 14:38", status: "DELIVERED", items: [{ pid: "p001", qty: 1 }, { pid: "p008", qty: 1 }], subtotal: 2548, shipping: 0, total: 2548, address: { name: "Bau Andalón", street: "Av. Francisco Villa 1180, Int. 4", area: "Versalles, Puerto Vallarta", state: "Jalisco · CP 48330" }, payment: { brand: "VISA", last4: "4242", msi: 12 }, timeline: [ { state: "REQUESTED", label: "Pedido recibido", t: "12 feb · 14:38", done: true }, { state: "ACCEPTED", label: "Confirmado por la tienda", t: "12 feb · 14:42", done: true }, { state: "READY", label: "Listo para envío", t: "12 feb · 17:10", done: true }, { state: "IN_PROGRESS", label: "En camino a tu dirección", t: "13 feb · 09:24", done: true }, { state: "DELIVERED", label: "Entregado", t: "14 feb · 11:50", done: true, pin: "8432" }, ], }, "AL-711981": { id: "AL-711981", date: "08 feb 2026 · 18:12", status: "IN_PROGRESS", items: [{ pid: "p005", qty: 1 }], subtotal: 1899, shipping: 0, total: 1899, address: { name: "Bau Andalón", street: "Av. Francisco Villa 1180, Int. 4", area: "Versalles, Puerto Vallarta", state: "Jalisco · CP 48330" }, payment: { brand: "MASTERCARD", last4: "5588", msi: 6 }, timeline: [ { state: "REQUESTED", label: "Pedido recibido", t: "08 feb · 18:12", done: true }, { state: "ACCEPTED", label: "Confirmado por la tienda", t: "08 feb · 18:18", done: true }, { state: "READY", label: "Listo para envío", t: "09 feb · 11:30", done: true }, { state: "IN_PROGRESS", label: "En camino — llega mañana entre 10 y 18", t: "10 feb · 09:14", done: true, current: true }, { state: "DELIVERED", label: "Entregado", t: "Llegada estimada: 11 feb", done: false }, ], }, }; const STATE_ORDER = ["REQUESTED", "ACCEPTED", "READY", "IN_PROGRESS", "DELIVERED"]; const OrderDetailPage = ({ params, onNav }) => { const order = ORDER_DETAIL_DATA[params?.id] || ORDER_DETAIL_DATA["AL-712304"]; const items = order.items.map(i => ({ ...CATALOG.find(p => p.id === i.pid), qty: i.qty })); const status = STATUS_LABEL[order.status]; return (
{order.date}