var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import { jsx as _jsx } from "react/jsx-runtime";
import { memo, useEffect } from "react";
import { useIsDarkModeEnabled } from "onyxia-ui/lib";
import { useDarkMode } from "storybook-dark-mode";
import { ThemeProvider, useTheme } from "../theme";
import { createMakeStyles } from "tss-react";
var makeStyles = createMakeStyles({ useTheme: useTheme }).makeStyles;
export var DocsComponentWrapper = memo(function (props) {
    var component = props.component;
    var setIsDarkModeEnabled = useIsDarkModeEnabled().setIsDarkModeEnabled;
    var isStorybookDarkModeEnabled = useDarkMode();
    var classes = useStyles().classes;
    useEffect(function () {
        setIsDarkModeEnabled(isStorybookDarkModeEnabled);
    }, [isStorybookDarkModeEnabled]);
    return (_jsx(ThemeProvider, { children: _jsx("div", __assign({ className: classes.contentWrapper }, { children: component })) }));
});
var useStyles = makeStyles()(function (theme) { return ({
    "contentWrapper": {
        "border": "solid ".concat(theme.colors.useCases.borderColor, " 1px"),
        "borderRadius": theme.borderRadius,
        "boxShadow": theme.boxShadow,
    },
}); });
//# sourceMappingURL=DocsComponentWrapper.js.map