// SONARA — Producer Dashboard sections
const DIcons = window.SonaraIcons;
const PlayIc = ({ size = 12 }) => ;
const ChevIc = ({ size = 14 }) => ;
const StarIc = ({ size = 12, filled = true }) => ;
const VerifIc = ({ size = 12 }) => ;
const ArrIc = ({ size = 14 }) => ;
const UpIc = ({ size = 12 }) => ;
/* ─────────── DA CONSEGNARE ─────────── */
function DaConsegnare() {
const items = [
{
id: "o1",
kind: "Mix + Master",
title: "EP \"Asfalto\"",
who: "RAZZA",
whoIn: "RZ",
net: 158,
deadline: -2, // overdue 2h
urgent: true,
activity: "Hai consegnato v1 · in revisione richiesta",
action: "Carica v2",
},
{
id: "o2",
kind: "Beat esclusivo",
title: "Notturno · uso esclusivo",
who: "Yoshi K.",
whoIn: "YK",
net: 308,
deadline: 22, // 22h
urgent: true,
activity: "Artista ha caricato i riferimenti · 1h fa",
action: "Apri brief",
},
{
id: "o3",
kind: "Mix stereo",
title: "Singolo \"Mezzanotte\"",
who: "M. Lentini",
whoIn: "ML",
net: 105,
deadline: 48,
urgent: false,
activity: "Stems completi · countdown attivo",
action: "Apri",
},
{
id: "o4",
kind: "Vocal production",
title: "Brano \"Senza Te\"",
who: "Sara D.",
whoIn: "SD",
net: 79,
deadline: 96,
urgent: false,
activity: "Attesa stems dell'artista · pausa countdown",
action: "Sollecita",
waiting: true,
},
];
const fmtDeadline = (h) => {
if (h < 0) return `In ritardo ${Math.abs(h)}h`;
if (h < 24) return `Tra ${h}h`;
return `Tra ${Math.round(h / 24)}gg`;
};
return (
);
}
/* ─────────── REVENUE PIPELINE ─────────── */
function RevenueCard() {
return (
In escrow
3 ordini in corso · si liberano alla consegna
€892 ,00
In clearance
Protezione chargeback · 7gg
€340 ,00
Prossimo auto-payout
Lunedì 18 maggio · IBAN ***4831
€1.247,60
Ultimi 30gg
€2.140,00
+24%
Ordini 30gg
14
su 47 lifetime
);
}
/* ─────────── OPPORTUNITÀ ─────────── */
function OpportunitaCard() {
const reqs = [
{
id: "r1",
kind: "Beat trap dark",
brief: "Cerco beat 808 pesante, BPM 138-145, tipo Travis Scott late-night",
budget: "€100-200",
offers: 4,
time: "2h fa",
new: true,
},
{
id: "r2",
kind: "Mix EP",
brief: "EP 5 tracce trap/drill, stems pronti, consegna entro 3 settimane",
budget: "€600-900",
offers: 7,
time: "5h fa",
new: false,
},
{
id: "r3",
kind: "Custom production",
brief: "Brano R&B con vibe Daniel Caesar/Brent Faiyaz, 1 beat + mix",
budget: "€400",
offers: 2,
time: "Ieri",
new: true,
},
];
return (
Opportunità per te
8 nuove
match generi
Tutte
);
}
/* ─────────── MESSAGGI ─────────── */
function MessagesCard() {
const msgs = [
{ who: "RAZZA", init: "RZ", verified: true, preview: "Perfetto, aspetto la v2 ✌️ ti faccio sentire anche un riferimento", time: "8m", unread: true, waiting: false },
{ who: "Yoshi K.", init: "YK", verified: true, preview: "Mi piacciono i riferimenti che hai mandato. Quanto per esclusiva?", time: "1h", unread: true, waiting: false },
{ who: "Sara D.", init: "SD", verified: false, preview: "Ti mando gli stems entro stasera, scusa il ritardo", time: "Ieri", unread: true, waiting: false },
{ who: "M. Lentini", init: "ML", verified: false, preview: "Ricevuti, suono pulitissimo. Procedo con il pagamento finale", time: "2gg", unread: false, waiting: true },
];
return (
);
}
/* ─────────── QUICK ACTIONS ─────────── */
function QuickActions() {
const actions = [
{ primary: true, t: "Carica nuovo beat", s: "Wizard 3-step · audio + metadata + licenze", ic: , href: "CaricaBeat.html" },
{ t: "Crea listing servizio", s: "Mix, master, custom, vocal prod", ic: , href: "CreaListing.html" },
{ t: "Sfoglia opportunità", s: "8 richieste open compatibili", ic: , href: "Opportunita.html" },
{ t: "Stats catalog", s: "Visite, ascolti, conversion per beat", ic: , href: "Catalog.html" },
];
return (
);
}
/* ─────────── STATS PERFORMANCE (full-width card) ─────────── */
function PerfStats() {
return (
Revenue 30gg
€2.140
+24% vs prec.
Ordini chiusi
14
su 47 lifetime
Rating ricevuto
4.8
{[1,2,3,4,5].map(n => )}
su 47 recensioni
Response time
4h 12m
Top 8% IT
Conversion catalog
3.8%
visite → vendita
Ranking trap IT
🏆
Top 12%
+3 posizioni questa sett.
);
}
/* ─────────── KYC BANNER (only when not verified) ─────────── */
function KycBanner({ status = "verified" }) {
if (status === "verified") return null;
const isReview = status === "in_review";
return (
{isReview ? "KYC in verifica" : "Completa il KYC per ricevere pagamenti"}
{isReview
? "I tuoi documenti sono in revisione. Risposta entro 1-3 giorni lavorativi."
: "Senza KYC i fondi restano in wallet ma non possono essere prelevati. Ci vogliono 5 minuti."}
{isReview ? "Vedi stato" : "Completa KYC"}
);
}
Object.assign(window, {
DaConsegnare, RevenueCard, OpportunitaCard, MessagesCard,
QuickActions, PerfStats, KycBanner,
});