import React, { useMemo } from "react";
import { ThemeProvider, useTheme } from "styled-components";
import { defaultTheme } from ".";
import { palettes } from "@ledgerhq/ui-shared";
import V3dDfaultTheme from "./theme";
export const InvertTheme = ({ if: condition, children, }) => {
    const theme = useTheme();
    const revertTheme = theme.theme === "light" ? "dark" : "light";
    const newTheme = useMemo(() => (Object.assign(Object.assign({}, defaultTheme), { colors: Object.assign(Object.assign({}, palettes[revertTheme]), { palette: palettes[revertTheme] }), theme: revertTheme })), [revertTheme]);
    return React.createElement(ThemeProvider, { theme: condition ? newTheme : theme }, children);
};
export const InvertThemeV3 = ({ children }) => {
    const theme = useTheme();
    const v3RevertTheme = theme.theme === "light" ? "dark" : "light";
    const newTheme = useMemo(() => (Object.assign(Object.assign(Object.assign({}, defaultTheme), V3dDfaultTheme), { colors: Object.assign(Object.assign(Object.assign({}, defaultTheme.colors), palettes[v3RevertTheme]), { palette: palettes[v3RevertTheme] }), theme: v3RevertTheme })), [v3RevertTheme]);
    return React.createElement(ThemeProvider, { theme: newTheme }, children);
};
//# sourceMappingURL=InvertTheme.js.map