import { ActionType } from "../../PageContent";
import { FormGorup, FormItem } from "../../BasicForm";
import pageModal from "./page-modal.vue";

export type PageModalInstance = typeof pageModal & {
  dialogVisible: boolean;
  confirmLoading: boolean;
  type: ActionType;
};

export interface ModalConfig {
  title: string;
  formItems?: Array<FormItem>;
  formGroup?: Array<FormGorup>;
  support?: Array<string>;
  colLayout?: any;
  itemStyle?: Record<string, string>;
  labelWidth?: string;
  contact?: string;
  divider?: boolean;
  needCompany?: boolean;
  onDataChange?: (data: any) => any;
}

export const modalProps = {
  modalConfig: {
    type: Object as PropType<ModalConfig>,
    required: true
  },
  prviewDescription: {
    type: Boolean,
    default: false
  },
  defaultInfo: {
    type: Object,
    required: true
  }
};

export const descritonProps = {
  config: {
    type: Object as PropType<ModalConfig>,
    required: true
  },
  defaultInfo: {
    type: Object,
    required: true
  }
};
