import { jsx as _jsx } from "react/jsx-runtime";
import { createContext, useState, useEffect } from 'react';
import '../../assets/Themes/Theme.scss';
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 };
export default ThemeProvider;
//# sourceMappingURL=ThemeProvider.js.map