/* ============================================================
STREAM WITH LIEN — Shared components & icons
============================================================ */
const { useState, useEffect, useRef, useCallback } = React;
/* ---------- Minimal inline icons ---------- */
function Icon({ name, size = 22, stroke = 2.2 }) {
const common = { width: size, height: size, viewBox: "0 0 24 24", fill: "none",
stroke: "currentColor", strokeWidth: stroke, strokeLinecap: "round", strokeLinejoin: "round" };
switch (name) {
case "arrow": return ();
case "arrowUp": return ();
case "arrowUpRight": return ();
case "play": return ();
case "menu": return ();
case "close": return ();
case "check": return ();
case "heart": return ();
case "music": return ();
case "spotify": return ();
case "twitch": return ();
case "discord": return ();
case "tiktok": return ();
case "instagram": return ();
case "x": return ();
case "youtube": return ();
case "mail": return ();
case "bag": return ();
default: return null;
}
}
/* ---------- Image placeholder ---------- */
function Ph({ label, h = 200, r, className = "", style = {} }) {
return (
{label}
);
}
/* ---------- Reveal on scroll ---------- */
function useReveal() {
const ref = useRef(null);
useEffect(() => {
const el = ref.current; if (!el) return;
const io = new IntersectionObserver((entries) => {
entries.forEach(e => { if (e.isIntersecting) { e.target.classList.add("in"); io.unobserve(e.target); } });
}, { threshold: 0.12, rootMargin: "0px 0px -8% 0px" });
el.querySelectorAll(".reveal").forEach(n => io.observe(el.classList.contains("reveal") ? el : n));
if (el.classList.contains("reveal")) io.observe(el);
return () => io.disconnect();
}, []);
return ref;
}
/* ---------- Button ---------- */
function Btn({ children, variant = "", size = "", icon, iconLeft, href, onClick, type, className = "" }) {
const cls = ["btn", variant && "btn--" + variant, size && "btn--" + size, className].filter(Boolean).join(" ");
const inner = (<>
{iconLeft && }
{children}
{icon && }
>);
if (href) return ({inner});
return ();
}
/* ---------- Live badge ---------- */
function LiveBadge({ live, ui }) {
if (live) return ({ui.live});
return (
{ui.offline});
}
/* ---------- Social row ---------- */
const SOCIALS = [
{ key: "tiktok", icon: "tiktok", label: "TikTok" },
{ key: "instagram", icon: "instagram", label: "Instagram" },
{ key: "x", icon: "x", label: "X" },
{ key: "youtube", icon: "youtube", label: "YouTube" },
];
function SocialRow({ social, big }) {
return (
);
}
/* ---------- Shared inner-page hero ---------- */
function PageHero({ kicker, title, lede, children }) {
const ref = useReveal();
return (
{kicker}
{title}
{lede &&
{lede}
}
{children}
);
}
Object.assign(window, { Icon, Ph, useReveal, Btn, LiveBadge, SocialRow, SOCIALS, PageHero });