import { createTheme, ThemeOptions } from "@mui/material";
import { deepmerge } from "@mui/utils";
import { components } from "./config/components";
import { palette as darkThemePalette } from "./config/palette-dark";
import { palette as lightThemePalette } from "./config/palette-light";
import { typography } from "./config/typography";

export const createLightTheme = (options: ThemeOptions = {}) =>
  createTheme(
    deepmerge(
      {
        components,
        palette: lightThemePalette,
        typography,
      },
      options,
    ),
  );

export const createDarkTheme = (options: ThemeOptions = {}) =>
  createTheme(
    deepmerge(
      {
        components,
        palette: darkThemePalette,
        typography,
      },
      options,
    ),
  );
