// Prodz — Network: explore & follow (no chat here). Two zones: // · "Le tue liste" — people you follow, grouped into lists. Auto by city and // by role; plus custom lists the user can create. // · "Da conoscere" — suggestions, CTA Follow function Network() { const { L } = useL(); const nav = useNav(); const { Avatar, Button, Tabs } = window.ProdzDesignSystem_d0b87b; const [zone, setZone] = useStateS('people'); const [following, setFollowing] = useStateS({}); // people you follow → everyone in the directory except yourself const FOLLOWED = Object.keys(PEOPLE).filter((id) => id !== 'me'); const [basis, setBasis] = useStateS('city'); // auto-group: city | role const [customLists, setCustomLists] = useStateS(() => ([ { id: 'cl1', name: { it: 'Team Collezione Noir', en: 'Collezione Noir team' }, members: ['sofia', 'nina', 'elena'] }, { id: 'cl2', name: { it: 'DP di fiducia', en: 'Trusted DPs' }, members: ['ale'] }, ])); const [detail, setDetail] = useStateS(null); // { title, icon, tint, members, custom } const [creating, setCreating] = useStateS(false); const [newName, setNewName] = useStateS(''); const [newMembers, setNewMembers] = useStateS({}); const listName = (n) => (typeof n === 'string' ? n : tr(L, n)); const autoGroups = () => { const map = {}; FOLLOWED.forEach((id) => { const p = PEOPLE[id]; const key = basis === 'city' ? p.city : tr(L, p.role); (map[key] = map[key] || []).push(id); }); return Object.entries(map).sort((a, b) => b[1].length - a[1].length || a[0].localeCompare(b[0])); }; const createList = () => { const members = Object.keys(newMembers).filter((k) => newMembers[k]); if (!newName.trim() || members.length === 0) return; setCustomLists((ls) => [{ id: 'cl' + Date.now(), name: newName.trim(), members }, ...ls]); setCreating(false); setNewName(''); setNewMembers({}); nav.toast(L('Lista creata', 'List created'), null); }; return (

Network

{L('Esplora la rete e fai crescere i contatti.', 'Explore the network and grow your contacts.')}

{zone === 'lists' && (

{L('Le persone che segui, raggruppate in liste.', 'The people you follow, grouped into lists.')}

{/* custom lists */}
{L('Personalizzate', 'Custom')}
{customLists.map((cl) => ( setDetail({ title: listName(cl.name), icon: 'Bookmark', tint: 'var(--prodz-gold)', members: cl.members, custom: true })} /> ))}
{/* auto-grouping basis */}
{L('Automatiche', 'Automatic')}
{[{ id: 'city', label: L('Per città', 'By city'), icon: 'MapPin' }, { id: 'role', label: L('Per ruolo', 'By role'), icon: 'Briefcase' }].map((o) => ( ))}
{autoGroups().map(([key, members]) => ( setDetail({ title: key, icon: basis === 'city' ? 'MapPin' : 'Briefcase', tint: 'var(--prodz-teal)', members, custom: false })} /> ))}
)} {/* list detail — members of a list */} setDetail(null)}> {detail && (
{detail.title}
{detail.members.length} {detail.members.length === 1 ? L('persona', 'person') : L('persone', 'people')}{detail.custom ? '' : L(' · automatica', ' · automatic')}
{detail.members.map((id) => { const p = PEOPLE[id]; return ( ); })}
)}
{/* create custom list */} setCreating(false)}> {L('Nuova lista', 'New list')} setNewName(e.target.value)} placeholder={L('Nome della lista…', 'List name…')} style={{ width: '100%', height: 46, padding: '0 14px', borderRadius: 'var(--radius-md)', border: 'none', outline: 'none', background: 'var(--surface-raised)', boxShadow: 'var(--ring-inset-hairline)', color: 'var(--text-body)', fontSize: 15, fontWeight: 600, fontFamily: 'var(--font-ui)' }} />

{L('Aggiungi persone', 'Add people')}

{FOLLOWED.map((id) => { const p = PEOPLE[id]; const on = !!newMembers[id]; return ( ); })}
{zone === 'people' && (
{SUGGESTIONS.map((id) => { const p = PEOPLE[id]; const isFollowing = !!following[id]; const stats = { prods: ((id.length * 3) % 9) + 2, threads: ((id.length * 2) % 6) + 1, jobs: (id.length % 3) }; return (
{/* what's visible on a person card: produzioni, thread, job call */}
); })}
)}
); } // A list card: leading icon, name + count, stacked member avatars. function ListCard({ icon, tint, name, members, onClick, Avatar, L }) { const shown = members.slice(0, 4); return ( ); } function MiniStat({ n, label }) { return (
{n} {label}
); } const pageTitle = { margin: 0, fontFamily: 'var(--font-display)', fontSize: 26, fontWeight: 800, letterSpacing: '-0.03em', color: 'var(--text-primary)' }; const pageSub = { margin: '4px 0 0', fontSize: 13, color: 'var(--text-muted)' }; const activityRow = { display: 'flex', alignItems: 'center', gap: 12, padding: '12px 4px', background: 'none', border: 'none', borderBottom: '1px solid var(--border-hairline)', cursor: 'pointer', textAlign: 'left', width: '100%' }; const personCard = { background: 'var(--surface-card)', borderRadius: 'var(--radius-lg)', boxShadow: 'var(--ring-inset-hairline)', padding: 16 }; const listCard = { display: 'flex', alignItems: 'center', gap: 12, width: '100%', padding: '12px 14px', background: 'var(--surface-card)', border: 'none', cursor: 'pointer', borderRadius: 'var(--radius-lg)', boxShadow: 'var(--ring-inset-hairline)' }; const listMemberRow = { display: 'flex', alignItems: 'center', gap: 12, width: '100%', padding: 10, background: 'var(--surface-raised)', border: 'none', cursor: 'pointer', borderRadius: 'var(--radius-md)' }; Object.assign(window, { Network, ListCard, MiniStat, pageTitle, pageSub });