// 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 (
{L('Esplora la rete e fai crescere i contatti.', 'Explore the network and grow your contacts.')}
{L('Le persone che segui, raggruppate in liste.', 'The people you follow, grouped into lists.')}
{/* custom lists */}{L('Aggiungi persone', 'Add people')}