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

export type ToastDynamicStyleType = {
    radiuses: NCoreUIKit.ActivePalette["radiuses"];
    spaces: NCoreUIKit.ActivePalette["spaces"];
    colors: NCoreUIKit.ActivePalette["colors"];
    currentType: ToastTypes;
    safeAreaBottom: number;
    subTitle?: string;
    type: ToastType;
};

export type ToastTypes = {
    containerColor: keyof NCoreUIKit.ContainerContentColors;
    subTitleColor: keyof NCoreUIKit.TextContentColors;
    actionColor: keyof NCoreUIKit.TextContentColors;
    titleColor: keyof NCoreUIKit.TextContentColors;
    iconColor: keyof NCoreUIKit.IconContentColors;
};

export type ToastTypeConstantType = {
    type: ToastType;
};

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

export type ToastInternalProps = {
    contentContainerStyle?: StyleProp<ViewStyle>[] | StyleProp<ViewStyle>;
    style?: StyleProp<ViewStyle>[] | StyleProp<ViewStyle>;
    action?: {
        onPress: (props: {
            closeAnimation: (props: {
                onClosed?: (props: {
                    id: string;
                }) => void;
            }) => void;
        }) => void;
        icon?: NCoreUIKitIcon;
        style?: ViewStyle;
        title?: string;
    };
    isCloseOnPressActionButton?: boolean;
    closeAnimationDelay?: number;
    openAnimationDelay?: number;
    isCloseOnPress?: boolean;
    autoCloseDelay?: number;
    isShowAction?: boolean;
    icon?: NCoreUIKitIcon;
    children?: ReactNode;
    subTitle?: string;
    type?: ToastType;
    title: string;
    id: string;
    onClosed?: (props: {
        id: string;
    }) => void;
    customTheme?: {
        gapPropagation?: NCoreUIKit.GapPropagationKey;
        sharpness?: NCoreUIKit.SharpnessKey;
        paletteKey?: NCoreUIKit.PaletteKey;
        themeKey?: NCoreUIKit.ThemeKey;
    };
};

interface IToastProps extends ToastInternalProps {
};

export type {
    IToastProps as default
};
