import {
  StyleProp,
  TextStyle,
  TouchableOpacityProps,
  ViewStyle,
} from 'react-native';
import {IconName, IconProps} from '@components/Icon';

export enum ButtonSizeType {
  small = 'small',
  medium = 'medium',
  large = 'large',
}

export enum ButtonVariantType {
  contained = 'contained',
  outlined = 'outlined',
  text = 'text',
}

export enum ButtonColorType {
  primary = 'primary',
  primaryDark = 'primaryDark',
  warning = 'warning',
  warningDark = 'warningDark',
  error = 'error',
  errorDark = 'errorDark',
  success = 'success',
  successDark = 'successDark',
  gray = 'gray',
  black = 'black',
}

export type ButtonSize = keyof typeof ButtonSizeType;

export type ButtonVariant = keyof typeof ButtonVariantType;

export type ButtonColor = keyof typeof ButtonColorType;

export interface ButtonProps extends Omit<TouchableOpacityProps, 'onPress'> {
  text: string;
  onPress?: () => void;
  variant?: ButtonVariant;
  size?: ButtonSize;
  color?: ButtonColor;
  loading?: boolean;
  textStyle?: StyleProp<TextStyle>;
  leftIconName?: IconName;
  iconColor?: string;
  rightIconName?: IconName;
}

export interface DynamicButtonStyles {
  containerStyle?: ViewStyle;
  textStyle?: TextStyle;
  iconProps?: Omit<IconProps, 'name'>;
}

export interface GetButtonStylesParams {
  variant: ButtonVariant;
  color: ButtonColor;
  size: ButtonSize;
  disabled?: boolean;
}
