// games.jsx — Game/provider cards + grid + bottom nav const { useState: useStateG } = React; /* ───────────────────────────────────────────────────────────── Rich game illustrations (SVG) ──────────────────────────────────────────────────────────── */ function GameArt({ kind, theme }) { switch (kind) { case "metalslug": return ; case "monkey": return ; case "olympus": return ; case "trex": return ; case "safari": return ; case "fortune": return ; case "sweet": return ; case "dragon": return ; default: return ; } } const baseGrad = (theme, kind) => { const palettes = { metalslug: theme === "neon" ? ["#FF00C8", "#3A0030"] : theme === "jade" ? ["#3a2814", "#15110D"] : ["#8B4513", "#2a1500"], monkey: theme === "neon" ? ["#FFEE00", "#5e006b"] : theme === "jade" ? ["#C8102E", "#3a0810"] : ["#FF8A00", "#3a1200"], olympus: theme === "neon" ? ["#00F0FF", "#0a1840"] : theme === "jade" ? ["#0F52BA", "#0A2F6E"] : ["#2E6BD8", "#0a1840"], trex: theme === "neon" ? ["#39FF14", "#0a3a14"] : theme === "jade" ? ["#2E7D5B", "#0F2E1F"] : ["#2A8A6F", "#0F2E1F"], safari: theme === "neon" ? ["#FF8800", "#5e1f00"] : theme === "jade" ? ["#D4AF37", "#3a2914"] : ["#E48A2A", "#3a1f00"], fortune: theme === "neon" ? ["#FF00C8", "#3a0028"] : theme === "jade" ? ["#C8102E", "#3a0810"] : ["#E60012", "#3a000a"], sweet: theme === "neon" ? ["#FF55AA", "#3a0028"] : theme === "jade" ? ["#9c2856", "#3a1428"] : ["#FF6FB5", "#3a1428"], dragon: theme === "neon" ? ["#6B5BFF", "#1a0a3a"] : theme === "jade" ? ["#006B3F", "#0F2E1F"] : ["#7A1A1A", "#2a0a0a"], }; return palettes[kind] || ["#222", "#000"]; }; function ArtFrame({ kind, theme, children }) { const [c1, c2] = baseGrad(theme, kind); return ( {/* corner glints */} {children} ); } function MetalSlugArt({ theme }) { return ( {/* tank body */} {/* cannon */} {/* tracks */} {/* explosion behind */} {/* logo */} METAL SLUG ); } function MonkeyArt({ theme }) { return ( {/* staff */} {/* head */} {/* ears */} {/* crown band */} {/* face */} {/* logo */} MONKEY KING ); } function OlympusArt({ theme }) { return ( {/* columns */} {/* lightning bolt */} OLYMPUS ); } function TRexArt({ theme }) { return ( {/* body */} {/* spikes */} {/* eye */} {/* teeth */} {/* fire */} RAGE T-REX 2 ); } function SafariArt({ theme }) { return ( {/* sun */} {/* horizon */} {/* tree trunk */} {/* tree canopy */} {/* lion silhouette */} SAFARI ); } function FortuneArt({ theme }) { return ( {/* gold ingot stack */} {/* red lantern */} 福 FORTUNE 88 ); } function SweetArt({ theme }) { return ( {/* candies */} {[[35, 40, "#FF55AA"], [78, 38, "#9C5BFF"], [56, 56, "#FFD24A"], [32, 76, "#39C9FF"], [82, 78, "#FF8A00"], [58, 88, "#FFFFFF"]].map(([cx, cy, fill], i) => ( ))} SWEET BONANZA ); } function DragonArt({ theme }) { return ( {/* dragon body curl */} {/* scales */} {/* head */} {/* horns */} JADE DRAGON ); } function GenericArt({ theme }) { return ( ? ); } /* ───────────────────────────────────────────────────────────── TopHotGames — backed by `games` table (active=true) ──────────────────────────────────────────────────────────── */ function TopHotGames({ theme }) { const { data } = window.useHotGames ? window.useHotGames() : { data: [] }; const games = Array.isArray(data) ? data : []; return (
{theme === "neon" ? "⚡" : theme === "jade" ? "❖" : "🔥"}

TOP{theme === "jade" ? " Featured Games" : "HOT GAMES"}

{games.map((g) => (
{g.is_hot &&
{theme === "neon" ? "LIVE" : theme === "jade" ? "新" : "HOT"}
}
{g.title}
{g.provider}
))}
); } window.TopHotGames = TopHotGames; /* ───────────────────────────────────────────────────────────── Provider tabs + grid ──────────────────────────────────────────────────────────── */ // Provider tab visual config (static — drives sidebar order/icons) const PROVIDER_TABS = [ { id: "slot1", label: "Slot 1:1", icon: "slot" }, { id: "slot100", label: "Slot 1:100", icon: "trophy" }, { id: "live", label: "Live Game", icon: "live" }, { id: "sport", label: "Sportbook", icon: "soccer" }, { id: "esport", label: "Esport", icon: "esport" }, { id: "fast", label: "Fast Game", icon: "lightning" }, ]; function ProviderSection({ theme }) { const [active, setActive] = useStateG("slot1"); const { data } = window.useProviders ? window.useProviders(active) : { data: [] }; const providers = Array.isArray(data) ? data : []; return (
S

All Provider

{PROVIDER_TABS.map((t) => ( ))}
{providers.map((p) => (
{p.tag && (
{p.tag}
)}
{p.name}
))}
); } window.ProviderSection = ProviderSection; /* ───────────────────────────────────────────────────────────── BottomNav ──────────────────────────────────────────────────────────── */ function BottomNav({ theme, route, navigate }) { const items = [ { id: "shop", label: "NEW", icon: "female", route: "/new", isFemale: true }, { id: "history", label: "History", icon: "history", route: "/history" }, { id: "promo", label: "Promo", icon: null, route: "/promo", isPromo: true }, { id: "chat", label: "LiveChat", icon: "chat", route: "/chat" }, { id: "settings", label: "Setting", icon: "settings",route: "/settings" }, ]; const PromoIcon = () => { if (theme === "neon") return ◉; if (theme === "jade") return 福; return ; }; const go = navigate || ((path) => { window.location.hash = path; }); return ( ); } window.BottomNav = BottomNav;