// Per Te (beat feed) + Stats + Profile completeness + Wallet
const Icons = window.SonaraIcons;
const { useState } = React;
function FeedTabs({ value, onChange }) {
const tabs = [
{ v: "perte", l: "Per te" },
{ v: "beat", l: "Beat" },
{ v: "producer", l: "Producer" },
{ v: "servizi", l: "Servizi" },
];
return (
{tabs.map(t => (
))}
);
}
function BeatCard({ beat }) {
const [playing, setPlaying] = useState(beat.playing || false);
const [fav, setFav] = useState(beat.fav || false);
return (
{Array.from({ length: 22 }).map((_, i) => (
))}
{beat.exclusive && Esclusiva}
{beat.bpm} BPM
{beat.key}
{beat.title}
€{beat.price}
{beat.prodInit}
{beat.producer}
{beat.verified && }
{beat.genre}
{beat.duration}
★ {beat.rating}
);
}
function PerTeFeed() {
const [tab, setTab] = useState("perte");
const beats = [
{ title: "Notte Rossa", price: "39", bpm: 142, key: "F min", producer: "Yoshi", prodInit: "Y", verified: true, genre: "Trap", duration: "2:48", rating: "4.9", cover: "b1", played: 35, playing: true, fav: false, exclusive: false },
{ title: "Tigre Blu", price: "29", bpm: 90, key: "C min", producer: "Marco Vitale", prodInit: "MV", verified: true, genre: "R&B", duration: "3:12", rating: "4.8", cover: "b2", played: 0, fav: true, exclusive: false },
{ title: "Skyline 04", price: "590", bpm: 138, key: "D min", producer: "Diego K.", prodInit: "DK", verified: true, genre: "Drill", duration: "2:34", rating: "5.0", cover: "b3", played: 0, exclusive: true },
{ title: "Lume", price: "19", bpm: 120, key: "G maj", producer: "Sara R.", prodInit: "SR", verified: false, genre: "Indie", duration: "3:00", rating: "4.6", cover: "b4", played: 0 },
{ title: "Vetro Caldo", price: "45", bpm: 128, key: "A min", producer: "Vale Frey", prodInit: "VF", verified: true, genre: "Pop", duration: "2:55", rating: "4.7", cover: "b5", played: 0 },
{ title: "Sud", price: "35", bpm: 100, key: "E min", producer: "Tommy O.", prodInit: "TO", verified: false, genre: "Hip-hop", duration: "3:20", rating: "4.5", cover: "b6", played: 0 },
];
return (
);
}
function Sparkline({ points = [3, 5, 4, 7, 6, 9, 8], color = "#7b55d0" }) {
const max = Math.max(...points);
const w = 100, h = 22;
const step = w / (points.length - 1);
const d = points.map((p, i) => `${i === 0 ? "M" : "L"}${i * step},${h - (p / max) * h}`).join(" ");
return (
);
}
function StatsCard() {
return (
Visite profilo
124
↑ 32% vs settimana scorsa
Ascolti showcase
328
↑ 18%
Salvataggi
14
stesso del solito
Rating medio
4,9 ★
su 7 collab
);
}
function ProfileCompleteness() {
const pct = 65;
const r = 24, c = 2 * Math.PI * r;
const items = [
{ t: "Foto profilo", pts: 15, done: true },
{ t: "Generi e città", pts: 10, done: true },
{ t: "Bio breve", pts: 10, done: true },
{ t: "Link Spotify / Instagram", pts: 10, done: false },
{ t: "Carica una traccia showcase", pts: 25, done: false },
{ t: "Verifica email", pts: 5, done: true },
];
return (
{pct}%
Completa il profilo
Profili sopra l'80% ricevono 3× più visite.
{items.map((it, i) => (
{it.done && }
{it.t}
+{it.pts}
{!it.done && }
))}
);
}
function WalletCard() {
return (
Saldo wallet
€25,00
+ €10,00 promo benvenuto · scade in 14 giorni
);
}
Object.assign(window, { PerTeFeed, BeatCard, StatsCard, ProfileCompleteness, WalletCard });