// Beat detail page — UC-A1 conversion screen // Big art + waveform player on left, license/buy block on right (sticky) // Below: producer card, similar beats, license terms, FAQ, reviews const BD_Icons = window.SonaraIcons; const { useState: useStateBD, useEffect: useEffectBD, useMemo: useMemoBD, useRef: useRefBD } = React; // Mock beat — uses ALL_BEATS[0] if available, otherwise inline const PICK_BEAT = () => (window.ALL_BEATS && window.ALL_BEATS[2]) || { id: 3, title: "Sognando blue moon", producer: { name: "Yoshi Beats", init: "Y", verified: true, art: "art-a", followers: 1240, rating: 4.8, reviews: 87, responseTime: "2h", location: "Milano" }, genre: "Trap", art: "art-a", bpm: 140, key: "A min", duration: "2:14", plays: 24300, likes: 412, price: 49, }; function BeatDetailPage() { const beat = useMemoBD(() => { const src = PICK_BEAT(); // Normalize the producer field — ALL_BEATS has producer as object already if (typeof src.producer === "string") { return { ...src, producer: { name: src.producer, init: src.producer.charAt(0), verified: true, art: src.art, followers: 1240, rating: 4.8, reviews: 87, responseTime: "2h", location: "Milano" } }; } return { ...src, producer: src.producer.name ? src.producer : { ...src.producer, name: src.producer, init: "Y", verified: true, art: src.art, followers: 1240, rating: 4.8, reviews: 87, responseTime: "2h", location: "Milano" } }; }, []); // Normalize once more, defensively const prod = beat.producer && beat.producer.name ? beat.producer : { name: String(beat.producer || "Yoshi Beats"), init: "Y", verified: true, art: beat.art || "art-a", followers: 1240, rating: 4.8, reviews: 87, responseTime: "2h", location: "Milano" }; const [selectedLicense, setSelectedLicense] = useStateBD("non-exclusive"); const [liked, setLiked] = useStateBD(false); const [playing, setPlaying] = useStateBD(false); const licenses = [ { id: "non-exclusive", label: "Non-esclusiva", price: 49, tagline: "Per release indie, demo, social", includes: ["MP3 + WAV", "Streaming illimitato", "Distribuzione Spotify/Apple", "Producer mantiene la track", "Credito obbligatorio"], limits: ["Max 100k stream/anno", "No sync TV/film", "No re-licensing"], popular: true, }, { id: "exclusive", label: "Esclusiva", price: 380, tagline: "Solo per te, ritirata dal catalogo", includes: ["Stems multitraccia (8 tracce)", "Streaming illimitato", "Sync TV/film/spot", "Track ritirata dal catalogo", "Credito opzionale", "Trasferimento copyright"], limits: ["Producer mantiene 30% mechanical royalty", "Pagamento singola soluzione"], popular: false, }, ]; const sel = licenses.find(l => l.id === selectedLicense); return (
{/* breadcrumb */}
{/* LEFT — beat hero */}
{/* Hero card with art + player */}
{beat.genre}
{beat.genre} Dark Notturno

{beat.title}

{prod.init} {prod.name} {prod.verified && }
{beat.bpm} BPM {beat.key} {(beat.plays/1000).toFixed(1)}k plays {beat.likes} like
{/* Player bar */}
{Array.from({ length: 80 }).map((_, i) => { const h = 20 + Math.abs(Math.sin(i * 0.6) * 30) + Math.abs(Math.cos(i * 0.13) * 20); const played = i < 26; return ; })}
0:42 Anteprima · 2:14 totali 2:14
{/* Tabs: Descrizione / Stems / Recensioni */} {/* Producer card */} {/* Similar beats */}
{/* RIGHT — buy box (sticky) */}
); } // ---------- Tabs ---------- function BeatTabs({ beat }) { const [tab, setTab] = useStateBD("desc"); return (
{tab === "desc" && (

Beat trap dark con atmosfera notturna e 808 grossi, perfetto per cori melodici e voci taglienti. Costruito attorno a un campione di pianoforte filtrato e un basso analogico con saturazione armonica.

Mixato con ProTools 2024, mastered su SSL G-Series. Lascia spazio in alto per voce in coda e ad-lib. Loop pulito di 8 battute con drop a 1:14.

Trap Dark Notturno 808 heavy Sfera-style Mood: cinematic
)} {tab === "details" && (
{[ ["BPM", "140"], ["Tonalità", "A minor"], ["Time signature", "4/4"], ["Durata", "2:14"], ["Bars (loop)", "8 + intro 4"], ["Drop", "01:14"], ["Sample rate", "48kHz / 24-bit"], ["Format", "WAV + MP3 320"], ["Stems", "8 tracce (su esclusiva)"], ["Software", "ProTools 2024"], ["Mastering", "SSL G-Series"], ["Genere primario", "Trap"], ].map(([k, v]) => (
{k} {v}
))}
)} {tab === "stems" && (
Gli stems sono inclusi solo nella licenza esclusiva. Acquistando, riceverai un .ZIP con 8 tracce separate.
{[ ["Kick", "Heavy 808 sub"], ["Snare + claps", "Layered, room verb"], ["Hi-hat", "Pattern + rolls"], ["Bass 808", "Saturato, glide"], ["Piano", "Pad filtrato"], ["Synth lead", "Detuned saw"], ["FX", "Risers + impacts"], ["Master bus", "Track stereo finale"], ].map(([n, d]) => (
{n} {d} Esclusiva
))}
)} {tab === "reviews" && (
4.8
{[1,2,3,4,5].map(i => )}
23 recensioni
{[ [5, 17], [4, 4], [3, 1], [2, 1], [1, 0], ].map(([s, c]) => (
{s}★ {c}
))}
{[ { who: "Marco T.", whoInit: "MT", time: "2 sett", stars: 5, text: "Beat pazzesco, l'808 è perfetto. Yoshi mi ha consegnato gli stems entro 2 ore dall'acquisto." }, { who: "VV", whoInit: "VV", time: "1 mese", stars: 5, text: "Ho fatto la mia release più grossa con questo beat. Top." }, { who: "Luca M.", whoInit: "LM", time: "1 mese", stars: 4, text: "Bel beat, avrei preferito un drop più aggressivo ma il mood è giusto." }, ].map((r, i) => (
{r.whoInit}
{r.who} {[1,2,3,4,5].map(x => )} {r.time}

{r.text}

))}
)}
); } // ---------- Producer inline ---------- function ProducerInline({ prod }) { return (
{prod.init}
{prod.name} {prod.verified && }
{prod.location} {prod.rating} · {prod.reviews} recensioni Risposta in {prod.responseTime}
Trap Drill Hip-hop
Contatta Vedi profilo
); } // ---------- Similar beats ---------- function SimilarBeats({ current }) { const beats = (window.ALL_BEATS || []).filter(b => b.id !== current).slice(0, 4); if (beats.length === 0) return null; return (
Beat simili Vedi catalogo
{beats.map(b => (
{b.title}
{typeof b.producer === "string" ? b.producer : (b.producer && b.producer.name) || "Yoshi"}
{b.bpm} BPM €{b.price || 49}
))}
); } window.BeatDetailPage = BeatDetailPage;