initial commit

This commit is contained in:
Daniil
2026-05-14 02:23:02 +03:00
commit b8b8247ff3
34 changed files with 3297 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import { useEffect, useState } from "react";
import { continueRender, delayRender } from "remotion";
export const useTheme = (theme: string) => {
const [isStyleLoaded, setIsStyleLoaded] = useState(theme === "__skip__");
useEffect(() => {
// When using inline styles (styleConfig), skip CSS theme loading entirely
if (theme === "__skip__") {
setIsStyleLoaded(true);
return;
}
const handle = delayRender(`Loading theme: ${theme}`);
import(`@/themes/${theme}.css`)
.then(() => {
setIsStyleLoaded(true);
continueRender(handle);
})
.catch((err) => {
console.error(`Failed to load theme: ${theme}`, err);
setIsStyleLoaded(true);
continueRender(handle);
});
}, [theme]);
return isStyleLoaded;
};