// Sidebar navigation + topbar for the artist dashboard const Icons = window.SonaraIcons; function Sidebar({ active = "home" }) { const marketplace = { key: "esplora", label: "Esplora", icon: , href: "Esplora.html", sub: "Beat, producer, servizi" }; const work = [ { key: "home", label: "Home", icon: , href: "Dashboard.html" }, { key: "progetti", label: "Progetti", icon: , badge: 3, href: "Progetti.html" }, { key: "messaggi", label: "Messaggi", icon: , badge: 5, href: "Messaggi.html" }, { key: "preferiti", label: "Preferiti", icon: , href: "Preferiti.html" }, ]; const biz = [ { key: "acquisti", label: "I miei acquisti", icon: , href: "Acquisti.html" }, { key: "richieste", label: "Richieste open", icon: , badge: 2, href: "Richieste.html" }, { key: "servizi", label: "I miei servizi", icon: , href: "PubblicaServizio.html" }, { key: "wallet", label: "Wallet", icon: , href: "Wallet.html" }, { key: "profilo", label: "Profilo pubblico", icon: , href: "Profilo.html" }, ]; return ( ); } function Topbar({ wallet = "25,00", theme = "dark", onToggleTheme }) { const [notifOpen, setNotifOpen] = React.useState(false); const notifRef = React.useRef(null); React.useEffect(() => { const onDown = (e) => { if (notifOpen && notifRef.current && !notifRef.current.contains(e.target)) setNotifOpen(false); }; document.addEventListener("mousedown", onDown); return () => document.removeEventListener("mousedown", onDown); }, [notifOpen]); const SunIcon = ({ size = 16 }) => ( ); const MoonIcon = ({ size = 16 }) => ( ); return (
⌘ K
Esplora Marketplace Feed 3
{notifOpen && setNotifOpen(false)}/>}
); } function Greet() { return (

Bentornato, Luca πŸ‘‹

Hai 2 deliverable da revisionare e 1 nuova offerta sulla tua richiesta.
); } function BottomNav({ active = "home" }) { const items = [ { key: "home", label: "Home", icon: , href: "Dashboard.html" }, { key: "esplora", label: "Esplora", icon: , href: "Esplora.html", primary: true }, { key: "progetti", label: "Progetti", icon: , badge: 3, href: "Progetti.html" }, { key: "chat", label: "Chat", icon: , badge: 5, href: "Messaggi.html" }, { key: "profilo", label: "Profilo", icon: , href: "Profilo.html" }, ]; return ( ); } /* ─────────────────────────────────────────────────── */ /* Notifications panel (popover) */ /* ─────────────────────────────────────────────────── */ const ARTIST_NOTIFICATIONS = [ { id: "an1", unread: true, time: "12m fa", urgent: true, title: "Deliverable da revisionare", body: "Nico Vega ha caricato la v1 del mix \"Notte Lunga\". Hai 7 giorni per approvare.", href: "Progetti.html", icon: "audioFile", accent: "warning", }, { id: "an2", unread: true, time: "45m fa", title: "Nuova offerta su richiesta", body: "Sara D'Onofrio ti ha mandato un'offerta per Mix EP \"Restami\" Β· €420", href: "Richieste.html", icon: "target", accent: "violet", }, { id: "an3", unread: true, time: "2h fa", title: "Messaggio da Nico Vega", body: "\"Ho ricevuto gli stems, mi metto al lavoro. Ti aggiorno entro 24h ✌️\"", href: "Messaggi.html", icon: "connect", accent: "violet", }, { id: "an4", unread: false, time: "Ieri", title: "Beat acquistato consegnato", body: "Il file WAV + stems di \"Caduta libera\" Γ¨ disponibile nella tua libreria.", href: "Acquisti.html", icon: "disc", accent: "success", }, { id: "an5", unread: false, time: "12 mag", title: "Pagamento confermato", body: "€180 in escrow per il progetto Mix \"Notte Lunga\" Β· si libera alla tua approvazione.", href: "Wallet.html", icon: "coins", accent: "success", }, { id: "an6", unread: false, time: "10 mag", title: "Producer suggerito per te", body: "Marco Lenti (R&B/soul Β· Bologna) ha pubblicato 3 nuovi beat che matchano i tuoi gusti.", href: "Esplora.html", icon: "user", accent: "violet", }, { id: "an7", unread: false, time: "8 mag", title: "Recensione doppia-cieca pubblicata", body: "La tua recensione a Nico Vega Γ¨ ora pubblica. Vedi cosa ha scritto su di te.", href: "Profilo.html", icon: "star", accent: "gold", }, ]; function ArtistNotificationsPanel({ onClose }) { const [filter, setFilter] = React.useState("all"); const unreadCount = ARTIST_NOTIFICATIONS.filter(n => n.unread).length; const items = filter === "unread" ? ARTIST_NOTIFICATIONS.filter(n => n.unread) : ARTIST_NOTIFICATIONS; return (
Notifiche {unreadCount > 0 && {unreadCount} nuove}
{items.map(n => { const Ic = Icons[n.icon] || Icons.bell; return (
{n.title} {n.time}
{n.body}
{n.unread && }
); })} {items.length === 0 && (
Nessuna notifica non letta
Sei in pari πŸŽ‰
)}
); } Object.assign(window, { Sidebar, Topbar, Greet, BottomNav, ArtistNotificationsPanel });