// Pages: Home, Shop, ProductDetail, Cart, Checkout, Confirmation, Admin const { useState: useStateP, useEffect: useEffectP, useMemo, useRef: useRefP } = React; // =============== HOME =============== function HomePage({ data, currency, rates, setCurrency, hero, onOpenProduct, onAdd, wish, onFav, onGoShop, points }) { return ( <>
Categorías

Explorá por ritual

onGoShop()} />
Más buscados

Lo que enamora

{ e.preventDefault(); onGoShop(); }}>Ver todo →
{data.products.filter(p => p.isBest).slice(0, 4).map(p => ( ))}
Esta semana

Novedades

Recién llegado

Para tu mesita de luz

{data.products.filter(p => p.isNew).slice(0, 4).map(p => ( ))}
mima edit · Belleza elegida con cuidado · 2026
); } // =============== SHOP / CATALOG =============== function ShopPage({ data, currency, rates, onOpenProduct, onAdd, wish, onFav, filter, setFilter }) { const [query, setQuery] = useStateP(""); const [sort, setSort] = useStateP("relevant"); const [loading, setLoading] = useStateP(true); useEffectP(() => { const t = setTimeout(() => setLoading(false), 700); return () => clearTimeout(t); }, []); const filtered = useMemo(() => { let arr = data.products; if (filter !== "all") arr = arr.filter(p => p.category === filter); if (query) { const q = query.toLowerCase(); arr = arr.filter(p => p.name.toLowerCase().includes(q) || p.tagline.toLowerCase().includes(q)); } if (sort === "price-asc") arr = [...arr].sort((a, b) => a.price - b.price); if (sort === "price-desc") arr = [...arr].sort((a, b) => b.price - a.price); if (sort === "new") arr = [...arr].sort((a, b) => (b.isNew ? 1 : 0) - (a.isNew ? 1 : 0)); return arr; }, [data.products, filter, query, sort]); return ( <>
La tienda

Todos los productos

setQuery(e.target.value)} />
{loading ? Array.from({ length: 6 }).map((_, i) => (
)) : filtered.length === 0 ?

Sin resultados

Probá con otros términos o categorías.

: filtered.map(p => ( )) }
); } // =============== PRODUCT DETAIL =============== function ProductDetailPage({ product, data, currency, rates, setCurrency, onBack, onAdd, isFav, onFav, onOpenProduct }) { const [qty, setQty] = useStateP(1); const [thumb, setThumb] = useStateP(0); const ctaRef = useRefP(null); const out = product.stock === 0; const low = product.stock > 0 && product.stock < 10; const related = data.products.filter(p => p.category === product.category && p.id !== product.id).slice(0, 4); return (
{[0, 1, 2].map(i => (
{data.categories.find(c => c.id === product.category)?.label}

{product.name}

{product.tagline}
{formatPrice(product.price, currency, rates)} {product.compareAt && {formatPrice(product.compareAt, currency, rates)}}

Descripción

{product.description}

{product.category === "perfumeria" ? "Notas" : "Activos"}

{product.notes.map((n, i) => (
{n}
))}
{qty}
{out ? SIN STOCK · TE AVISAMOS CUANDO VUELVA : low ? QUEDAN {product.stock} UNIDADES : EN STOCK · ENVÍO 24-72 HS }
{out && ( )}

Reseñas · {product.rating} ★ ({product.reviews})

{data.reviews.slice(0, 3).map(r => (
{r.author} {r.date}
{"★".repeat(r.rating)}{"☆".repeat(5 - r.rating)}

{r.text}

))}
{related.length > 0 && (

También te puede gustar

{related.slice(0, 2).map(p => ( ))}
)}
Total {formatPrice(product.price * qty, currency, rates)}
); } // =============== CART SHEET =============== function CartSheet({ items, products, currency, rates, onClose, onQty, onRemove, onCheckout, coupon, setCoupon }) { const lines = items.map(i => ({ ...i, product: products.find(p => p.id === i.id) })).filter(l => l.product); const subtotal = lines.reduce((s, l) => s + l.product.price * l.qty, 0); const discount = coupon === "MIMA10" ? subtotal * 0.10 : 0; const shipping = subtotal > 0 && subtotal < 35000 ? 4500 : 0; const total = subtotal - discount + shipping; const empty = lines.length === 0; return ( <>

Tu carrito {!empty && · {lines.length} {lines.length === 1 ? "ítem" : "ítems"}}

{empty ?

Tu carrito está vacío

Sumá productos y volvé acá.

: lines.map(l => (
{l.product.name}
{l.product.tagline}
{formatPrice(l.product.price * l.qty, currency, rates)}
{l.qty}
)) }
{!empty && (
setCoupon(e.target.value.toUpperCase())} />
Subtotal{formatPrice(subtotal, currency, rates)}
{discount > 0 &&
Cupón MIMA10− {formatPrice(discount, currency, rates)}
}
Envío {subtotal >= 35000 && (gratis)}{shipping === 0 ? "Gratis" : formatPrice(shipping, currency, rates)}
Total{formatPrice(total, currency, rates)}
)}
); } // =============== CHECKOUT =============== function CheckoutPage({ items, products, currency, rates, onBack, onPlaceOrder, coupon }) { const [step, setStep] = useStateP(1); const [shippingMethod, setShippingMethod] = useStateP("envio"); const [paymentMethod, setPaymentMethod] = useStateP("mp"); const [form, setForm] = useStateP({ email: "", nombre: "", telefono: "", direccion: "", ciudad: "", provincia: "Buenos Aires", cp: "", }); const lines = items.map(i => ({ ...i, product: products.find(p => p.id === i.id) })).filter(l => l.product); const subtotal = lines.reduce((s, l) => s + l.product.price * l.qty, 0); const discount = coupon === "MIMA10" ? subtotal * 0.10 : 0; const shippingCost = shippingMethod === "envio" ? (subtotal >= 35000 ? 0 : 4500) : shippingMethod === "nacional" ? 6800 : 0; const total = subtotal - discount + shippingCost; const update = (k, v) => setForm(f => ({ ...f, [k]: v })); return (
Finalizar compra
1 ? " done" : "")}> {step > 1 ? : "1"} Datos 2 ? " done" : "")}> {step > 2 ? : "2"} Envío 3 Pago
{step === 1 && ( <>

¿Cómo te contactamos?

update("email", e.target.value)} placeholder="vos@email.com" type="email" />
update("nombre", e.target.value)} placeholder="María Pérez" />
update("telefono", e.target.value)} placeholder="+54 9 11 ..." />
)} {step === 2 && ( <>

¿Cómo lo recibís?

setShippingMethod("envio")} style={{ borderColor: shippingMethod === "envio" ? "var(--sage-700)" : "var(--line)" }}>
{shippingMethod === "envio" && }
Envío a domicilio · CABA / GBA
24 a 72 hs hábiles
{subtotal >= 35000 ? "Gratis" : formatPrice(4500, currency, rates)}
setShippingMethod("nacional")} style={{ borderColor: shippingMethod === "nacional" ? "var(--sage-700)" : "var(--line)" }}>
{shippingMethod === "nacional" && }
Envío nacional · Andreani / OCA
3 a 7 días hábiles
{formatPrice(6800, currency, rates)}
setShippingMethod("retiro")} style={{ borderColor: shippingMethod === "retiro" ? "var(--sage-700)" : "var(--line)" }}>
{shippingMethod === "retiro" && }
Retiro en showroom · Palermo
Lu a Vi 11 a 19 hs
Gratis
{shippingMethod !== "retiro" && ( <>

Dirección de entrega

update("direccion", e.target.value)} placeholder="Av. Santa Fe 1234, 4°B" />
update("ciudad", e.target.value)} placeholder="CABA" />
update("cp", e.target.value)} placeholder="1425" />
)} )} {step === 3 && ( <>

Método de pago

{[ { id: "mp", nm: "Mercado Pago", sb: "Tarjetas, débito, dinero en cuenta" }, { id: "transfer", nm: "Transferencia bancaria", sb: "5% off · te enviamos los datos" }, { id: "tarjeta", nm: "Link de pago tarjeta", sb: "Hasta 6 cuotas sin interés" }, { id: "efectivo", nm: "Efectivo", sb: "Solo retiro en showroom" }, { id: "wpp", nm: "Coordinar por WhatsApp", sb: "Te escribimos para terminar" }, ].map(m => (
setPaymentMethod(m.id)}>
{m.nm}
{m.sb}
))}

Resumen

Subtotal{formatPrice(subtotal, currency, rates)}
{discount > 0 &&
Cupón MIMA10− {formatPrice(discount, currency, rates)}
}
Envío{shippingCost === 0 ? "Gratis" : formatPrice(shippingCost, currency, rates)}
Total{formatPrice(total, currency, rates)}
)}
TOTAL {formatPrice(total, currency, rates)}
); } // =============== CONFIRMATION =============== function ConfirmationPage({ orderId, onHome }) { return (

¡Listo!

Recibimos tu pedido y ya está en preparación.
Te enviamos el detalle por email.

PEDIDO #{orderId}
); } // =============== WISHLIST =============== function WishlistPage({ data, currency, rates, wish, onFav, onOpenProduct, onAdd }) { const items = data.products.filter(p => wish.has(p.id)); return ( <>
Tu lista

Favoritos

{items.length} GUARDADOS
{items.length === 0 ?

Aún no guardaste nada

Tocá el corazón para guardar productos.

:
{items.map(p => ( ))}
} ); } // =============== ACCOUNT =============== function AccountPage({ points, onOpenAdmin, currency, setCurrency }) { return ( <>
Hola

Magdalena Ríos

M
{[ { i: I.Bag, l: "Mis pedidos", s: "3 activos" }, { i: I.Heart, l: "Favoritos", s: "" }, { i: I.Bell, l: "Notificaciones", s: "Avisos de stock activos" }, { i: I.Settings, l: "Datos y direcciones", s: "" }, ].map((it, i) => { const Ic = it.i; return ( ); })}
Moneda

mima edit · v1.0

); } Object.assign(window, { HomePage, ShopPage, ProductDetailPage, CartSheet, CheckoutPage, ConfirmationPage, WishlistPage, AccountPage });