// Prodz — Saved items & Locations marketplace.
// · SavedItems — review what you saved, organised in moodboards
// (folders of productions, locations, moments, gear).
// · LocationsMarketplace — "Esplora" from Home opens a searchable, filterable
// catalogue of bookable spaces.
// ---------- resolve a saved reference to a display tile ----------
function resolveSaved(it, L) {
if (it.t === 'production') { const p = PRODUCTIONS.find((x) => x.id === it.id); return p && { img: p.image, title: p.title, sub: tr(L, p.meta), badge: L('Produzione', 'Production'), tint: 'var(--prodz-teal)' }; }
if (it.t === 'location') { const p = LOCATIONS_ALL.find((x) => x.id === it.id); return p && { img: p.image, title: p.title, sub: tr(L, p.price), badge: 'Location', tint: 'var(--purple)' }; }
if (it.t === 'moment') { const p = MOMENTS.find((x) => x.id === it.id); return p && { img: p.image, title: tr(L, p.label), sub: 'Set Moment', badge: 'Moment', tint: 'var(--prodz-gold)' }; }
if (it.t === 'gear') { const p = GEAR.find((x) => x.id === it.id); return p && { img: p.img, icon: p.icon, title: p.name, sub: tr(L, p.price), badge: 'Gear', tint: 'var(--blue)' }; }
return null;
}
function SavedItems() {
const { L } = useL();
const nav = useNav();
const { Button } = window.ProdzDesignSystem_d0b87b;
const boards = nav.moodboards;
const [open, setOpen] = useStateS(null);
const board = boards.find((b) => b.id === open);
const openItem = (it) => {
if (it.t === 'production') nav.openProduction(it.id);
else if (it.t === 'location') nav.openLocations();
};
return (
(board ? setOpen(null) : nav.pop())} showLang={false} />
{!board && (
<>
{L('Elementi salvati', 'Saved items')}
{L('Rivedi ciò che hai salvato, raccolto in moodboard.', 'Review what you saved, gathered into moodboards.')}
{boards.map((b) => (
))}
{/* create folder */}
>
)}
{board && (
{board.items.map((it, i) => {
const r = resolveSaved(it, L); if (!r) return null;
return (
);
})}
)}
);
}
// ---------- Locations marketplace ----------
function LocationsMarketplace() {
const { L } = useL();
const nav = useNav();
const { Button } = window.ProdzDesignSystem_d0b87b;
const [q, setQ] = useStateS('');
const [cat, setCat] = useStateS('ALL');
const [sel, setSel] = useStateS(null);
const list = LOCATIONS_ALL.filter((lc) => (cat === 'ALL' || lc.cat === cat) && (!q || lc.title.toLowerCase().includes(q.toLowerCase())));
return (
{L('Marketplace location', 'Locations marketplace')}
{L('Trova e prenota spazi per le tue produzioni.', 'Find and book spaces for your productions.')}
{/* search */}
{/* category filters */}
{['ALL'].concat(LOCATION_CATS).map((c) => (
setCat(c)} label={c === 'ALL' ? L('Tutte', 'All') : c} />
))}
{/* results */}
{list.map((lc) => (
))}
{list.length === 0 &&
{L('Nessuna location trovata.', 'No locations found.')}
}
setSel(null)}>
{sel && (
{sel.sponsored &&
{L('In evidenza · Sponsorizzato', 'Featured · Sponsored')}}
{sel.title}
{tr(L, sel.meta)} · {tr(L, sel.price)}
} onClick={() => { setSel(null); nav.toast(L('Salvato negli elementi', 'Saved to your items'), null); }}>{L('Salva', 'Save')}
} onClick={() => { setSel(null); nav.openInbox(); }}>{L('Contatta', 'Contact')}
)}
);
}
function FilterChip({ active, onClick, label }) {
return (
);
}
Object.assign(window, { SavedItems, LocationsMarketplace, FilterChip });