/*
 * @Author: pikachu
 * @Date: 2021-04-28 09:20:56
 * @LastEditors: Please set LastEditors
 */
import { App } from "vue";
import {
  Button,
  ConfigProvider,
  DatePicker,
  Form,
  Input,
  Layout,
  Checkbox,
  Radio,
  Menu,
  message,
  Modal,
  Popover,
  Select,
  Table,
  Popconfirm,
  Tabs,
  Switch,
  Dropdown,
  Drawer,
  Tooltip,
  InputNumber,
  Affix,
  Descriptions,
  Card,
  Steps,
  Upload,
  List,
  Spin,
  Progress,
  Cascader,
  Breadcrumb,
  Divider,
  Empty,
  Slider,
  Pagination
} from "ant-design-vue";

import VueClipboard3 from "./vue-clipboard";
import VueConfirmDirective from "./vue-confirm";
import VueQrCode from "./vue-qrcode";

import { ModalConfirmKey } from "./injectionKey";
import confirmButton from "@/components/confirm-button.vue"

const install = (app: App<Element>) => {
  app.provide(ModalConfirmKey, Modal.confirm);
  app.config.globalProperties.$confirm = Modal.confirm;
  app.config.globalProperties.$message = message;
  app.component('confirm-button', confirmButton)

  return app
    .use(VueClipboard3)
    .use(Radio)
    .use(VueConfirmDirective)
    .use(VueQrCode)
    .use(ConfigProvider)
    .use(Layout)
    .use(InputNumber)
    .use(Dropdown)
    .use(Menu)
    .use(Tooltip)
    .use(Popconfirm)
    .use(Form)
    .use(Affix)
    .use(Tabs)
    .use(Checkbox)
    .use(Input)
    .use(Button)
    .use(Select)
    .use(DatePicker)
    .use(Table)
    .use(Popover)
    .use(Switch)
    .use(Modal)
    .use(Descriptions)
    .use(Drawer)
    .use(Card)
    .use(Steps)
    .use(List)
    .use(Spin)
    .use(Upload)
    .use(Progress)
    .use(Cascader)
    .use(Breadcrumb)
    .use(Divider)
    .use(Empty)
    .use(Slider)
    .use(Pagination);
};

export default install;
