import { type PaletteOptions } from '@mui/material/styles';
import { PALETTE } from './colors';

declare module '@mui/material/styles' {
  interface Palette {
    club: Palette['primary']; // Extend Palette to include 'club'
  }
  interface PaletteOptions {
    club?: PaletteOptions['primary']; // Extend PaletteOptions for optional 'club'
  }

  interface TypeBackground {
    primary: string;
  }
}

declare module '@mui/material/Button' {
  interface ButtonPropsColorOverrides {
    club: true;
  }
}

// TODO: move this to types
// has typo
export type PalleteColor =
  | 'primary'
  | 'secondary'
  | 'error'
  | 'success'
  | 'warning'
  | 'info'
  | 'club';

export const lightPalette: PaletteOptions = {
  mode: 'light',
  primary: PALETTE.primary.light,
  secondary: PALETTE.secondary.light,
  action: PALETTE.action.light,
  error: PALETTE.error.light,
  success: PALETTE.success.light,
  warning: PALETTE.warning.light,
  info: PALETTE.info.light,
  background: PALETTE.background.light,
  text: PALETTE.text.light,
  club: PALETTE.club.light,
  divider: PALETTE.divider.light,
};

export const darkPalette: PaletteOptions = {
  mode: 'dark',
  primary: PALETTE.primary.dark,
  secondary: PALETTE.secondary.dark,
  action: PALETTE.action.dark,
  error: PALETTE.error.dark,
  success: PALETTE.success.dark,
  warning: PALETTE.warning.dark,
  info: PALETTE.info.dark,
  background: PALETTE.background.dark,
  text: PALETTE.text.dark,
  club: PALETTE.club.dark,
  divider: PALETTE.divider.dark,
};
