import type {
    SetStateAction,
    ReactElement,
    Dispatch,
    Ref
} from "react";
import {
    type NCoreUIKitIcon
} from "../../types";
import type {
    IBottomSheetRef
} from "../bottomSheet/type";
import type IBottomSheetProps from "../bottomSheet/type";

export type SelectSheetDynamicStyleType = {
    radiuses: NCoreUIKit.ActivePalette["radiuses"];
    spaces: NCoreUIKit.ActivePalette["spaces"];
    colors: NCoreUIKit.ActivePalette["colors"];
    isSearchable?: boolean;
};

export type SelectedItem = {
    __title: string;
    __key: string;
};

interface ISelectSheetProps<T> {
    selectObject: (selectedItem: T & SelectedItem | SelectedItem) => void;
    keyExtractor: (item: T & SelectedItem, index: number) => string;
    searchedData: Array<SelectedItem | (T & SelectedItem)>;
    renderItem?: (props: {
        onSelect: (selectedItem: SelectedItem) => void;
        data: Array<T & SelectedItem | SelectedItem>;
        setIsMoreLoading: (state: boolean) => void;
        setIsLoading: (state: boolean) => void;
        selectedItems: Array<SelectedItem>;
        isSelected: boolean;
        searchText: string;
        item: SelectedItem;
        index: number;
        key: string;
    }) => ReactElement;
    customTheme?: {
        gapPropagation?: NCoreUIKit.GapPropagationKey;
        sharpness?: NCoreUIKit.SharpnessKey;
        paletteKey?: NCoreUIKit.PaletteKey;
        themeKey?: NCoreUIKit.ThemeKey;
    };
    customLocalize?: {
        activeLocale?: NCoreUIKit.LocaleKey;
    };
    onMoreLoad?: (props: {
        data: Array<T & SelectedItem | SelectedItem>;
        setIsMoreLoading: (state: boolean) => void;
        setIsLoading: (state: boolean) => void;
        selectedItems: Array<SelectedItem>;
        searchText: string;
    }) => void;
    setSearchText: Dispatch<SetStateAction<string>>;
    setIsLoading: Dispatch<SetStateAction<boolean>>;
    setIsActive: Dispatch<SetStateAction<boolean>>;
    data: Array<SelectedItem | (T & SelectedItem)>;
    bottomSheetRef: Ref<IBottomSheetRef> | null;
    setIsMoreLoading: (state: boolean) => void;
    LoadingIconComponentProp?: NCoreUIKitIcon;
    moreLoadThreshold?: number;
    bottomSheetProps?: Omit<
        IBottomSheetProps,
        "key" |
        "customKey" |
        "ref" |
        "isAutoHeight" |
        "isActive" |
        "renderBottom" |
        "renderHeader" |
        "onClose"
    >;
    renderOptionIcon?: (props: {
        item: T & SelectedItem | SelectedItem;
        index: number;
    }) => ReactElement;
    mainSelectedItems: Array<SelectedItem>;
    isWorkWithRealtime: boolean;
    isMultipleSelect?: boolean;
    isMoreLoading: boolean;
    isSearchable?: boolean;
    isShowTools?: boolean;
    selectAll: () => void;
    selectBoxKey: string;
    cleanAll: () => void;
    maxChoice?: number;
    minChoice?: number;
    searchText: string;
    isLoading: boolean;
    cancel: () => void;
    isActive: boolean;
    ok: () => void;
    title?: string;
};
export type {
    ISelectSheetProps as default
};
