Fix data pipelines once and for all

This commit is contained in:
Andras Schmelczer 2026-06-10 21:27:32 +01:00
parent 08560476c5
commit 4012e4e047
46 changed files with 4508 additions and 855 deletions

View file

@ -0,0 +1,18 @@
import { useEffect, useState } from 'react';
/**
* Tracks whether dark mode is active by observing the html.dark class.
* Useful in components that don't receive the theme as a prop (showcase,
* pricing backdrop) but must keep canvas/map content in sync with it.
*/
export function useIsDarkTheme(): boolean {
const [isDark, setIsDark] = useState(() => document.documentElement.classList.contains('dark'));
useEffect(() => {
const observer = new MutationObserver(() =>
setIsDark(document.documentElement.classList.contains('dark'))
);
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] });
return () => observer.disconnect();
}, []);
return isDark;
}