export function ThemeScript() { const codeToRunOnClient = ` (function() { var effectiveTheme = 'light'; try { var theme = localStorage.getItem('theme') || 'light'; effectiveTheme = theme; if (theme === 'system') { effectiveTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; } } catch (e) { effectiveTheme = 'light'; } var root = document.documentElement; root.classList.remove('light', 'dark'); root.classList.add(effectiveTheme); root.dataset.theme = effectiveTheme; root.style.colorScheme = effectiveTheme; })() `; return (