'use client';

import { useEffect } from 'react';
import { useThemeStore } from '@/stores/themeStore';

export default function ThemeInitializer() {
  const { theme } = useThemeStore();

  useEffect(() => {
    if (typeof window !== 'undefined') {
      const root = document.documentElement;
      root.classList.remove('theme-rtv', 'theme-netflix', 'theme-spotify', 'theme-hbo', 'theme-disney');
      root.classList.add(`theme-${theme}`);
    }
  }, [theme]);

  return null;
}
