import { lightThemeOptions, darkThemeOptions } from "./defaults";
import { createTheme, Theme } from "@mui/material/styles";

type Themes = {
  default: Theme;
};

const overrides = {
  typography: {
    h1: {
      fontSize: "3rem"
    },
    h2: {
      fontSize: "2rem"
    },
    h3: {
      fontSize: "1.64rem"
    },
    h4: {
      fontSize: "1.5rem"
    },
    h5: {
      fontSize: "1.285rem"
    },
    h6: {
      fontSize: "1.142rem"
    }
  }
};

const getThemes = (darkMode: boolean): Themes => {
  const defaultTheme = darkMode ? darkThemeOptions : lightThemeOptions;
  const dTheme = createTheme({
    ...defaultTheme,
    ...overrides
  });

  return {
    default: dTheme
  };
};

export { getThemes };
