import { jsx } from 'react/jsx-runtime';
import { createContext, useState, useEffect } from 'react';

const ThemeContext = createContext(undefined);
const ThemeProvider = ({ children, theme }) => {
    const [currentTheme, setCurrentTheme] = useState(theme || 'ff-light-theme');
    const applyTheme = (newTheme) => setCurrentTheme(newTheme);
    useEffect(() => {
        document.body.className = currentTheme;
        return () => {
            document.body.className = '';
        };
    }, [currentTheme]);
    return (jsx(ThemeContext.Provider, { value: { currentTheme, setCurrentTheme, applyTheme }, children: children }));
};

export { ThemeContext, ThemeProvider as default };
//# sourceMappingURL=ThemeProvider.js.map
