import React, { useState } from 'react'; import * as API from '../api'; export default function FestivalThemeManager({ activeTheme, onThemeChange, onBack }) { const [loading, setLoading] = useState(false); const [successMsg, setSuccessMsg] = useState(''); const themes = [ { id: 'default', name: 'Default Obsidian', primary: '#6C63FF', accent: '#00D4AA', desc: 'Core dark brand theme with electric violet gradients.' }, { id: 'diwali', name: 'Diwali Spark', primary: '#FFB300', accent: '#FF0077', desc: 'Golden marigold glow with festive pink and yellow highlights.' }, { id: 'holi', name: 'Holi Splash', primary: '#FF0077', accent: '#8F00FF', desc: 'Vibrant organic pigments, neon pink and purple overlays.' }, { id: 'monsoon', name: 'Monsoon Jitter', primary: '#3B82F6', accent: '#00E676', desc: 'Deep storm blue tiles with emerald safe-dispatch routing.' } ]; const handleSelectTheme = async (themeId) => { setLoading(true); setSuccessMsg(''); try { const res = await API.updateFestivalSettings(themeId); if (res) { onThemeChange(themeId); setSuccessMsg(`Active festival settings updated to ${themeId.toUpperCase()}`); setTimeout(() => setSuccessMsg(''), 3000); } } catch (err) { alert("Failed to update festival theme: " + err.message); } finally { setLoading(false); } }; return (
{/* Header */}

Festival Theme Manager

{onBack && ( )}
{/* Main Content */}

HyperFlow Theme Orchestrator

Change CSS color variables across all user surfaces, riders, and maps in real time.

{successMsg && (
check_circle {successMsg}
)} {/* Themes Grid */}
{themes.map(t => (
!loading && handleSelectTheme(t.id)} className={`bg-[#0C0C0C] border p-6 flex flex-col gap-4 rounded-2xl cursor-pointer hover:scale-[1.01] transition-all relative overflow-hidden group ${ activeTheme === t.id ? 'border-[#6C63FF] bg-[#6C63FF]/5' : 'border-white/5' }`} > {activeTheme === t.id && (
ACTIVE
)}

{t.name}

{t.desc}

{/* Theme Color Indicator Strip */}
Primary
Accent
))}
); }