import Vue from "vue";
import { BookDetail } from "../view/namespace.js";

import vueTouch from "vue-touch";
import VueClipboard from "vue-clipboard2";

import {
  Swipe,
  SwipeItem,
  InfiniteScroll,
  Spinner,
  Lazyload,
  Toast,
  Indicator,
  TabContainer,
  TabContainerItem,
  Popup,
  Picker,
  MessageBox
} from "mint-ui";

import XBook from "./book.vue";
import XPage from "./page.vue";
import XBookInfo from "./book-info.vue";
import XFooter from "./footer.vue";
import XHeader from "./header.vue";
import XShelfCore from "./shelf-core.vue";
// import XReader from './reader'
VueClipboard.config.autoSetContainer = true;

Vue.use(vueTouch);
Vue.use(VueClipboard);

Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
Vue.component(Spinner.name, Spinner);
Vue.component(Picker.name, Picker);
Vue.use(InfiniteScroll);
Vue.component(Popup.name, Popup);
Vue.use(Lazyload, {
  loading: "https://cdn-novel.bookkks.com/book/cover/loading.png"
});
Vue.component(TabContainer.name, TabContainer);
Vue.component(TabContainerItem.name, TabContainerItem);
Vue.prototype.$Toast = Toast;
Vue.prototype.$Indicator = Indicator;

Vue.prototype.$MessageBox = MessageBox;
Vue.component(XPage.name, XPage);
Vue.use(XBook, {
  click(book) {
    this.$router.push({ name: BookDetail.name, query: { id: book.book_id } });
  }
});
Vue.component(XFooter.name, XFooter);
Vue.component(XHeader.name, XHeader);
Vue.component(XBookInfo.name, XBookInfo);
Vue.component(XShelfCore.name, XShelfCore);
// Vue.component(XReader.name, XReader);
