import {COLORS} from '@shared/colors';
import {windowDimensions} from '@shared/constants';

import {
  ButtonColorType,
  ButtonSizeType,
  DynamicButtonStyles,
} from './interfaces';

export const BUTTON_MIN_WIDTH = 120;

export const BUTTON_SIZE_MAPPER: {
  [key: string]: DynamicButtonStyles;
} = {
  [ButtonSizeType.large]: {
    containerStyle: {
      width: '100%',
      height: 42,
    },
    textStyle: {
      fontSize: 15,
      fontWeight: '500',
    },
    iconProps: {
      size: 'md',
    },
  },
  [ButtonSizeType.medium]: {
    containerStyle: {
      width: windowDimensions.width / 2,
      height: 36,
    },
    textStyle: {
      fontSize: 14,
      fontWeight: '500',
    },
    iconProps: {
      size: 'sm',
    },
  },
  [ButtonSizeType.small]: {
    containerStyle: {
      alignSelf: 'flex-start',
      height: 30,
      paddingHorizontal: 10,
      gap: 2,
    },
    textStyle: {
      fontSize: 13,
      fontWeight: '500',
    },
    iconProps: {
      size: 'sm',
    },
  },
};

export const BUTTON_COLOR_MAPPER = {
  [ButtonColorType.primary]: COLORS.PRIMARY,
  [ButtonColorType.primaryDark]: COLORS.PRIMARY_DARK,
  [ButtonColorType.error]: COLORS.ERROR,
  [ButtonColorType.errorDark]: COLORS.ERROR_DARK,
  [ButtonColorType.success]: COLORS.SUCCESS,
  [ButtonColorType.successDark]: COLORS.SUCCESS_DARK,
  [ButtonColorType.warning]: COLORS.WARNING,
  [ButtonColorType.warningDark]: COLORS.WARNING_DARK,
  [ButtonColorType.gray]: COLORS.GRAY_THIRTY_THREE,
  [ButtonColorType.black]: COLORS.BLACK,
};
