/* =========================================================================== VESTIRÉ STUDIO — admin: gowns · gown editor · users · sales → window =========================================================================== */ const { useState, useEffect, useRef, useMemo } = React; /* ---- GOWNS MANAGEMENT ---------------------------------------------------- */ function AGowns({ ctx }) { const [q, setQ] = useState(""); const [cat, setCat] = useState("All"); const list = ctx.gowns.filter((g) => (cat === "All" || g.category === cat) && (q === "" || g.name.toLowerCase().includes(q.toLowerCase()))); return (
| Gown | Category | Offered | Rent | Buy | Stock | Actions |
|---|---|---|---|---|---|---|
|
{g.name}{g.color} · {g.occasion}
|
{g.category} | {g.transaction} | {g.priceRent ? VS.peso(g.priceRent) : "—"} | {g.priceBuy ? VS.peso(g.priceBuy) : "—"} |
{g.stock}
|
|
| Customer | Contact | Location | Requests | Joined | Actions |
|---|---|---|---|---|---|
{initials(u.fullname)} {u.fullname}@{u.username} |
{u.email}{u.phone} |
{u.address} | {reqs.length} | {fmtDate(u.createdAt)} | |
|
{u.fullname.split(" ")[0]}'s requests
{reqs.length === 0 && No requests yet.}
{reqs.map((r) => (
ctx.nav("requests", { focus: r.id })}>
{r.code}
))}
{r.items.slice(0, 3).map((it, i) =>
{fmtDate(r.createdAt)} · {r.type}
| |||||
| Ref | Customer | Address | Type | Rental Start | Days | Total | Payment | Status | Order Date | |
|---|---|---|---|---|---|---|---|---|---|---|
| No records in this period. | ||||||||||
| {r.code} | {r.customer.name} | {r.customer.email} | {r.customer.address} | {r.type} | {r.rentalStart ? fmtDate(r.rentalStart) : "—"} | {r.rentalDays || "—"} | {VS.peso(r.total.toFixed(2))} | {r.payment} | {r.status} | {fmtDate(r.createdAt)} |
| Total revenue | {VS.peso(totals.revenue.toFixed(2))} | |||||||||
| Ref | Customer | Type | Rental | Total | Payment | Status | Order date |
|---|---|---|---|---|---|---|---|
| {r.code} | {r.customer.name}{r.customer.email} |
{r.type} | {r.rentalStart ? fmtDate(r.rentalStart) + " · " + r.rentalDays + "d" : "—"} | {VS.peso(r.total)} | {r.payment} | {fmtDate(r.createdAt)} | |
| No orders in this period. | |||||||