// Account.jsx — Mi cuenta with sidebar tabs (profile, addresses, payments, orders, favorites, settings) const { useState: useAcctState } = React; const ACCT_SECTIONS = [ { id: "compras", label: "Mis compras", icon: "shopping_basket" }, { id: "favoritos", label: "Mis favoritos", icon: "favorite" }, { id: "perfil", label: "Mi perfil", icon: "person" }, { id: "direcciones", label: "Mis direcciones",icon: "location_on" }, { id: "pagos", label: "Métodos de pago",icon: "credit_card" }, { id: "ajustes", label: "Ajustes", icon: "tune" }, ]; const AccountPage = ({ user, params, onNav, onLogout, onOpenPdp, onOpenOrder, favs, onUnfav }) => { const [tab, setTab] = useAcctState(params?.tab || "compras"); const initials = (user?.name || "Allen").split(/\s+/).map(s => s[0]).slice(0, 2).join("").toUpperCase(); const toast = useToast(); return (
s.id === tab)?.label]} />
{/* SIDEBAR */} {/* CONTENT */}
{tab === "compras" && } {tab === "favoritos" && } {tab === "perfil" && } {tab === "direcciones" && } {tab === "pagos" && } {tab === "ajustes" && }
); }; // ----- Orders ----- const ORDERS = [ { id: "AL-712304", date: "12 feb 2026", status: "DELIVERED", items: [{ pid: "p001", qty: 1 }, { pid: "p008", qty: 1 }], total: 2548 }, { id: "AL-711981", date: "08 feb 2026", status: "IN_PROGRESS",items: [{ pid: "p005", qty: 1 }], total: 1899 }, { id: "AL-711440", date: "30 ene 2026", status: "DELIVERED", items: [{ pid: "p003", qty: 2 }, { pid: "p010", qty: 1 }], total: 1017 }, { id: "AL-710882", date: "14 ene 2026", status: "CANCELLED", items: [{ pid: "p007", qty: 1 }], total: 5499 }, ]; const STATUS_LABEL = { REQUESTED: { label: "Solicitado", fg: "var(--warning)", bg: "var(--warning-bg)" }, ACCEPTED: { label: "Aceptado", fg: "var(--primary-press)", bg: "var(--primary-soft)" }, IN_PROGRESS: { label: "En camino", fg: "#8A6500", bg: "var(--warning-bg)" }, READY: { label: "Listo", fg: "var(--success)",bg: "var(--success-bg)" }, DELIVERED: { label: "Entregado", fg: "var(--success)",bg: "var(--success-bg)" }, CANCELLED: { label: "Cancelado", fg: "var(--error)", bg: "var(--error-bg)" }, }; const OrdersTab = ({ onOpenPdp, onOpenOrder }) => { const [filter, setFilter] = useAcctState("all"); const filtered = filter === "all" ? ORDERS : ORDERS.filter(o => o.status === filter); return (

Mis compras

{ORDERS.length} pedidos en total

{[ { id: "all", label: "Todas" }, { id: "IN_PROGRESS", label: "En camino" }, { id: "DELIVERED", label: "Entregadas" }, { id: "CANCELLED", label: "Canceladas" }, ].map(f => ( ))}
{filtered.map(o => { const status = STATUS_LABEL[o.status]; const items = o.items.map(i => CATALOG.find(p => p.id === i.pid)).filter(Boolean); return (
Pedido #{o.id} {o.date}
{status.label}
{items.map(p => ( ))}
{items[0]?.name}
{items.length > 1 &&
y {items.length - 1} producto{items.length > 2 ? "s" : ""} más
}
Total
${o.total.toLocaleString("es-MX")}
{o.status === "DELIVERED" && ( )}
{o.status === "IN_PROGRESS" && (
Llega mañana entre 10:00 y 18:00 · Salió del centro Allen Vallarta · Ver seguimiento
)}
); })}
); }; // ----- Favorites ----- const FavoritesTab = ({ favs, onOpenPdp, onUnfav }) => { const items = CATALOG.filter(p => favs?.has(p.id)); return (

Mis favoritos

{items.length} producto{items.length === 1 ? "" : "s"} guardado{items.length === 1 ? "" : "s"}

{items.length === 0 ? ( ) : (
{items.map(p => ( onOpenPdp(p)} onFav={() => onUnfav(p)} onAdd={() => onOpenPdp(p)} /> ))}
)}
); }; // ----- Profile ----- const ProfileTab = ({ user }) => { const [form, setForm] = useAcctState({ name: user?.name || "Bau Andalón", email: user?.email || "bau@allenmx.com", phone: "+52 322 145 2287", birthday: "1992-08-12", gender: "no-decir", }); const toast = useToast(); return (

Mi perfil

Actualiza tus datos personales y de contacto.

{form.name.split(/\s+/).map(s => s[0]).slice(0, 2).join("").toUpperCase()}
{form.name}
Miembro Allen desde 2024 · 4 compras
setForm({ ...form, name: e.target.value })} /> setForm({ ...form, email: e.target.value })} /> setForm({ ...form, phone: e.target.value })} /> setForm({ ...form, birthday: e.target.value })} />
toast("Cambios guardados")}>Guardar cambios
); }; // ----- Addresses ----- const ADDRESSES = [ { id: "a1", label: "Casa", name: "Bau Andalón", street: "Av. Francisco Villa 1180, Int. 4", area: "Versalles, Puerto Vallarta", state: "Jalisco", zip: "48330", phone: "+52 322 145 2287", default: true }, { id: "a2", label: "Oficina", name: "Bau Andalón", street: "Calle Honduras 156", area: "5 de Diciembre, Puerto Vallarta", state: "Jalisco", zip: "48350", phone: "+52 322 145 2287" }, ]; const AddressesTab = () => (

Mis direcciones

Agregar dirección

La dirección predeterminada se usa en cada compra.

{ADDRESSES.map(a => (
{a.label} {a.default && Predeterminada}
{a.name}
{a.street}
{a.area}
{a.state} · CP {a.zip}
{a.phone}
{!a.default && ( )}
))}
); // ----- Payments ----- const CARDS = [ { id: "c1", brand: "VISA", last4: "4242", exp: "08/28", default: true, gradient: "linear-gradient(135deg, #1F3A93 0%, #0A1740 100%)" }, { id: "c2", brand: "MASTERCARD", last4: "5588", exp: "11/27", default: false, gradient: "linear-gradient(135deg, #18181B 0%, #3A3A40 100%)" }, ]; const PaymentsTab = () => (

Métodos de pago

Agregar tarjeta

Tus datos están cifrados. Nunca guardamos el CVV.

{CARDS.map(c => (
{c.brand}
•••• {c.last4}
Bau Andalón EXP {c.exp}
{c.default && ( Predeterminada )}
))}
{/* Other payment methods */}

Otros métodos

{[ { name: "PayPal", icon: "credit_card", bg: "var(--bg-branding)" }, { name: "Mercado Pago", icon: "credit_card", bg: "#FEF1C7" }, { name: "OXXO efectivo", icon: "shopping_basket",bg: "var(--orange-bg)" }, ].map(m => ( ))}
); // ----- Settings ----- const SettingsTab = () => { const [s, setS] = useAcctState({ promos: true, orderUpd: true, push: false, sms: true, lang: "es-MX" }); return (

Ajustes

Notificaciones, idioma y preferencias de cuenta.

{[ { key: "promos", label: "Ofertas y promociones", sub: "Te avisamos cuando algo de tu lista esté en oferta." }, { key: "orderUpd", label: "Actualizaciones de pedido", sub: "Cuando tu pedido cambia de estado." }, { key: "push", label: "Notificaciones push", sub: "En tu navegador o app." }, { key: "sms", label: "SMS", sub: "Para entregas y códigos de seguridad." }, ].map((row, i, arr) => (
{row.label}
{row.sub}
setS({ ...s, [row.key]: v })} />
))}

Idioma y región

Eliminar cuenta

Se borrarán tus pedidos, favoritos y direcciones. No se puede deshacer.

); }; const Switch = ({ on, onChange }) => ( ); const EmptyBox = ({ icon, title, sub }) => (

{title}

{sub}

); const outlineBtn = { background: "var(--bg-elev-1)", color: "var(--fg-strong)", border: "1px solid var(--border-strong)", padding: "8px 16px", borderRadius: "9999px", font: "600 12px var(--font-sans)", cursor: "pointer" }; const ghostBtn = { background: "transparent", color: "var(--primary)", border: 0, font: "700 13px var(--font-sans)", cursor: "pointer" }; const iconChipBtn = { width: 32, height: 32, borderRadius: 16, background: "var(--bg-elev-2)", border: 0, display: "grid", placeItems: "center", cursor: "pointer", color: "var(--fg-muted)" }; window.AccountPage = AccountPage; // Status table reused by OrderDetail.jsx Object.assign(window, { STATUS_LABEL });