import {createContext, Dispatch} from "react";
import {MenuProps} from "antd";

export enum IndexListDataType {
    PROJ,
    AGENT,
    CATEGORY,
    CATEGORY_CHANGE,
    CATEGORY_DELETE
}

export interface ListData {
    type: IndexListDataType;
    status?: string;
    category?: string;
    categorys?: MenuProps['items'];
    categoryChangeCount: number;
}

export interface ListAction {
    type: IndexListDataType;
    value: string | MenuProps['items'];
}


export const IndexListContext = createContext<ListData>({
    type: IndexListDataType.PROJ,
    categoryChangeCount: 0,
})

export const IndexListDispatchContext = createContext<Dispatch<ListAction>>(() => {
})