// Prodz — own-profile library: the "MIE cose" pages reached from the profile // section rows (Productions · Shoutouts · Locations · Gear · Threads), the // Archived mirror of those sections, and Settings (language). // // · SettingsScreen — app settings; currently the language toggle. // · ArchivedLibrary — same five sections, but the archived posts. // · MySection — one section's items (active or archived). // · ProfileSectionRows — the tappable row list, shared by profile + archive. // ---- The five "my things" sections ---- const PROFILE_SECTIONS = [ { id: 'prods', icon: 'Clapperboard', label: { it: 'Produzioni', en: 'Productions' } }, { id: 'shouts', icon: 'Megaphone', label: { it: 'Shoutouts', en: 'Shoutouts' } }, { id: 'locations', icon: 'MapPin', label: { it: 'Location', en: 'Locations' } }, { id: 'gear', icon: 'Camera', label: { it: 'Gear', en: 'Gear' } }, { id: 'threads', icon: 'MessagesSquare', label: { it: 'Threads', en: 'Threads' } }, ]; // ---- "Mine" datasets, split active vs archived (mock) ---- const MY_PRODS_ARCHIVED = [ { id: 'arch-aurora', title: 'Aurora — Test', image: IMG.studio, cat: 'TEST', meta: { it: 'Test luce · 2024', en: 'Lighting test · 2024' } }, { id: 'arch-metro', title: 'Linee Metro', image: IMG.interior, cat: 'REPORTAGE', meta: { it: 'Reportage · 2023', en: 'Reportage · 2023' } }, ]; const MY_GEAR_ITEMS = [ { id: 'mg1', name: 'Sony FX6', kind: { it: 'Cinema camera', en: 'Cinema camera' }, img: IMG.camera, icon: 'Camera' }, { id: 'mg2', name: 'Sigma 85mm f/1.4', kind: { it: 'Obiettivo', en: 'Lens' }, img: IMG.lens, icon: 'Aperture' }, { id: 'mg3', name: 'Aputure 600d Pro', kind: { it: 'Illuminazione', en: 'Lighting' }, img: null, icon: 'Lightbulb' }, ]; const MY_GEAR_ARCHIVED = [ { id: 'mg4', name: 'Canon C300 Mk II', kind: { it: 'Cinema camera', en: 'Cinema camera' }, img: null, icon: 'Camera' }, ]; const MY_LOC_ACTIVE = ['loft', 'rooftop'].map((id) => LOCATIONS_ALL.find((l) => l.id === id)).filter(Boolean); const MY_LOC_ARCHIVED = ['garage'].map((id) => LOCATIONS_ALL.find((l) => l.id === id)).filter(Boolean); const MY_THREADS_ACTIVE = THREADS.slice(0, 2); const MY_THREADS_ARCHIVED = THREADS.slice(2); // Normalised tiles for a given section + state. `tint` colours the badge. function mySectionItems(section, archived, L, nav) { const T = (o) => o; switch (section) { case 'prods': { if (archived) return MY_PRODS_ARCHIVED.map((p) => T({ key: p.id, img: p.image, title: p.title, sub: tr(L, p.meta), badge: p.cat, tint: 'var(--prodz-teal)', onTap: () => nav.toast(L('Produzione archiviata', 'Archived production'), null) })); return PRODUCTIONS.map((p) => T({ key: p.id, img: p.image, title: p.title, sub: tr(L, p.meta), badge: p.cat, tint: 'var(--prodz-teal)', onTap: () => nav.openProduction(p.id) })); } case 'shouts': { const open = MY_SHOUTOUTS.filter((s) => s.status === 'open'); const closed = MY_SHOUTOUTS.filter((s) => s.status !== 'open'); return (archived ? closed : open).map((s) => { const prod = PRODUCTIONS.find((x) => x.id === s.prod); return T({ key: s.id, icon: s.kind === 'job' ? 'Megaphone' : 'Handshake', tint: s.kind === 'job' ? 'var(--prodz-gold)' : 'var(--prodz-teal)', title: tr(L, s.title), sub: `${prod ? prod.title : ''} · ${s.applicants} ${L('cand.', 'appl.')}`, badge: s.kind === 'job' ? L('Job Call', 'Job Call') : 'Collab', onTap: () => nav.openShoutout(s.id, 'me') }); }); } case 'locations': { return (archived ? MY_LOC_ARCHIVED : MY_LOC_ACTIVE).map((l) => T({ key: l.id, img: l.image, title: l.title, sub: tr(L, l.price), badge: 'Location', tint: 'var(--purple)', onTap: () => archived ? nav.toast(L('Annuncio archiviato', 'Archived listing'), null) : nav.openLocations() })); } case 'gear': { return (archived ? MY_GEAR_ARCHIVED : MY_GEAR_ITEMS).map((g) => T({ key: g.id, img: g.img, icon: g.icon, title: g.name, sub: tr(L, g.kind), badge: 'Gear', tint: 'var(--blue)', onTap: () => nav.toast(L('Apertura scheda gear…', 'Opening gear card…'), null) })); } case 'threads': { return (archived ? MY_THREADS_ARCHIVED : MY_THREADS_ACTIVE).map((th) => T({ key: th.id, icon: 'MessagesSquare', tint: 'var(--prodz-teal)', title: tr(L, th.title), sub: `${th.replies} ${L('risposte', 'replies')} · ${th.likes} ${L('mi piace', 'likes')}`, badge: 'Thread', onTap: () => nav.openThread(th.id) })); } default: return []; } } function mySectionCount(section, archived) { switch (section) { case 'prods': return archived ? MY_PRODS_ARCHIVED.length : PRODUCTIONS.length; case 'shouts': return MY_SHOUTOUTS.filter((s) => (archived ? s.status !== 'open' : s.status === 'open')).length; case 'locations': return (archived ? MY_LOC_ARCHIVED : MY_LOC_ACTIVE).length; case 'gear': return (archived ? MY_GEAR_ARCHIVED : MY_GEAR_ITEMS).length; case 'threads': return (archived ? MY_THREADS_ARCHIVED : MY_THREADS_ACTIVE).length; default: return 0; } } // ---- Horizontal section navbar + inline grid (profile + archive share it) ---- function ProfileSections({ archived = false }) { const { L } = useL(); const nav = useNav(); const [tab, setTab] = useStateS('prods'); const def = PROFILE_SECTIONS.find((s) => s.id === tab) || PROFILE_SECTIONS[0]; const items = mySectionItems(tab, archived, L, nav); return (
{archived ? L('Niente di archiviato qui.', 'Nothing archived here.') : L('Ancora nessun elemento.', 'No items yet.')}
; } return ({archived ? L('I tuoi post archiviati in questa sezione.', 'Your archived posts in this section.') : L('Tutto ciò che hai pubblicato qui.', 'Everything you posted here.')}
{L('I tuoi post archiviati, per sezione.', 'Your archived posts, by section.')}
{L('Preferenze dell’app.', 'App preferences.')}