import type {
    ReactNode
} from "react";
import {
    type ButtonProps,
    type ViewStyle,
    type StyleProp,
    type TextStyle
} from "react-native";
import {
    type NCoreUIKitIcon
} from "../../types";

export type HighlightButtonDynamicStyleType = {
    displayBehaviourWhileLoading?: HighlightButtonDisplayBehaviourWhileLoading;
    customBorderColor?: keyof NCoreUIKit.ProjectColorPalette | (string & {});
    customColor?: keyof NCoreUIKit.ProjectColorPalette | (string & {});
    spreadBehaviour?: HighlightButtonSpreadBehaviour;
    radiuses: NCoreUIKit.ActivePalette["radiuses"];
    spaces: NCoreUIKit.ActivePalette["spaces"];
    colors: NCoreUIKit.ActivePalette["colors"];
    currentSize: HighlightButtonMeasures;
    currentType: HighlightButtonTypes;
    iconDirection?: "left" | "right";
    borders: NCoreUIKit.Borders;
    isCustomPadding?: boolean;
    type: HighlightButtonType;
    icon?: NCoreUIKitIcon;
    glassEffect?: number;
    isDisabled?: boolean;
    isLoading?: boolean;
    title?: string;
};

export type HighlightButtonMeasuresKeys = {
    paddingHorizontal: keyof NCoreUIKit.Spaces;
    paddingVertical: keyof NCoreUIKit.Spaces;
    fontSize: keyof NCoreUIKit.Typography;
};

export type HighlightButtonTypes = {
    borderColor: keyof NCoreUIKit.BorderContentColors;
    titleColor: keyof NCoreUIKit.TextContentColors;
    iconColor: keyof NCoreUIKit.IconContentColors;
    containerColor: keyof NCoreUIKit.LowColors;
};

export type HighlightButtonMeasures = {
    fontSize: keyof NCoreUIKit.Typography;
    paddingHorizontal: number;
    paddingVertical: number;
};

export type HighlightButtonTypeConstantType = {
    type: HighlightButtonType;
};

export type HighlightButtonSizeConstantType = {
    spaces: NCoreUIKit.ActivePalette["spaces"];
    size: HighlightButtonSize;
};

export type HighlightButtonType = "glass" | "primary" | "danger" | "warning" | "neutral" | "success" | "info";

export type HighlightButtonDisplayBehaviourWhileLoading = "none" | "disabled";

export type HighlightButtonSpreadBehaviour = "baseline" | "stretch" | "free";

export type HighlightButtonSize = "small" | "medium" | "large";

interface IHighlightButtonProps extends Omit<ButtonProps, "title" | "disabled"> {
    displayBehaviourWhileLoading?: HighlightButtonDisplayBehaviourWhileLoading;
    customBorderColor?: keyof NCoreUIKit.ProjectColorPalette | (string & {});
    customIconColor?: keyof NCoreUIKit.ProjectColorPalette | (string & {});
    customTextColor?: keyof NCoreUIKit.ProjectColorPalette | (string & {});
    customColor?: keyof NCoreUIKit.ProjectColorPalette | (string & {});
    titleStyle?: StyleProp<TextStyle>[] | StyleProp<TextStyle>;
    customTheme?: {
        gapPropagation?: keyof NCoreUIKit.GapPropagationKey;
        sharpness?: keyof NCoreUIKit.SharpnessKey;
        paletteKey?: keyof NCoreUIKit.PaletteKey;
        themeKey?: keyof NCoreUIKit.ThemeKey;
    };
    style?: StyleProp<ViewStyle>[] | StyleProp<ViewStyle>;
    spreadBehaviour?: HighlightButtonSpreadBehaviour;
    iconDirection?: "left" | "right";
    renderLoading?: () => ReactNode;
    size?: HighlightButtonSize;
    type?: HighlightButtonType;
    isCustomPadding?: boolean;
    icon?: NCoreUIKitIcon;
    glassEffect?: number;
    isDisabled?: boolean;
    onPress: () => void;
    isLoading?: boolean;
    title?: string;
}
export type {
    IHighlightButtonProps as default
};
