import { ProColumns, ProFormColumnsType } from '@ant-design/pro-components';

type MyColumnsType =
  | ProFormColumnsType<any, 'text'>
  | ProColumns<any, FormFieldType | 'text' | any>;

type MyResponseType = {
  success?: boolean;
  data?: any;
  errorCode?: number;
  errorMessage?: string;
  showType?: ErrorShowType;
  meta?: MyPaginationMetaType;
};

type MyPaginationMetaType = {
  current_page: number;
  last_page: number;
  per_page: number;
  total: number;
};

type MyParamsType<T> = {
  q: T;
  p?: { page: number; perPage: number };
  t?: { sorter: { sort: string; order: string } };
};

type PermissionsType = MenuDataItem & {
  parent_id: number;
};

type MyModalRefType = {
  showModal: (data: MyModalProps) => void;
  hideModal: () => void;
};

// export type MyModalFormProps = {
//   refresh: () => void;
//   item?: Record<string, any>;
//   title: string;
// } & ModalFormProps;

type MyProFormFieldProps<T> = {
  value?: T;
  onChange?: (value: T) => void;
};

// type MyEnumItemProps = {
//   label: string;
//   value: string | number;
//   color: string;
//   textColor: string;
// };

export type MyBetaModalFormProps = {
  title?: string;
  // action: ActionType | undefined;
  reload?: () => void;
  item?: Record<string, any>;
  extra?: React.ReactNode;
};

export type MyProEnumItemProps = {
  [key: string]: {
    text: string;
    color?: string;
  };
};
