// home.jsx — HomePage // t, useState, useEffect etc. available from components.jsx (loaded first) function HomePage({ data, setRoute, onOpenDestiny }) { const seed = data || DOPO.SEED; const { user, services, assets, memories, people } = seed; const totalItems = services.length + assets.length; const assignedItems = services.filter(s => s.destiny && s.destiny !== null).length + assets.filter(a => a.destiny && a.destiny !== null).length; const memoriesCount = memories.length; const circleCount = people.length; const unassignedServices = services.filter(s => !s.destiny).slice(0, 3); const latestMemories = memories.slice(0, 4); const latestServices = services.slice(0, 5); const hour = new Date().getHours(); const greeting = hour < 12 ? 'Buongiorno' : hour < 18 ? 'Buon pomeriggio' : 'Buonasera'; const suggestions = [ { icon: 'shield', color: 'var(--olive-500)', title: 'Completa l\'inventario', desc: `${totalItems - assignedItems} servizi senza destino. Decidili ora.`, action: () => setRoute('inventory'), }, { icon: 'memories', color: 'var(--jade-700)', title: 'Scrivi una memoria', desc: 'Una lettera, un audio, una foto. Per chi ami.', action: () => setRoute('memories'), }, { icon: 'circle', color: 'var(--gr-700)', title: 'Invita la cerchia', desc: `${people.filter(p => !p.invited).length} persone non ancora invitate.`, action: () => setRoute('circle'), }, ]; const kindLabel = { letter: 'Lettera', audio: 'Audio', photo: 'Foto', video: 'Video', doc: 'Documento' }; const kindClass = { letter: 'mem-letter', audio: 'mem-audio', photo: 'mem-photo', video: 'mem-video', doc: 'mem-doc' }; return (
{t.home.hero_sub}
| Servizio | Categoria | Destino | Persone | |
|---|---|---|---|---|
|
{s.name}
{s.email}
|
{s.category} |
|
{s.assignees.length > 0 ? (
|