"use client"; import React, { useEffect, useState } from 'react'; export function SoundInitializer({ children }) { const [isReady, setIsReady] = useState(false); const [error, setError] = useState(null); useEffect(() => { const initializeSounds = async () => { try { // Simulate sound initialization setIsReady(true); } catch (err) { setError(err.message || 'Failed to initialize sounds'); } }; initializeSounds(); }, []); if (error) { return

Error: {error}

; } if (!isReady) { return

Loading sounds...

; } return <>{children}; }