import hsLinebar from './line-bar/index'
import hsPie from './pie/index'
import hsRadar from './radar/index'
import hsTable from './hs_table/index'
import hsCarousel from './hs-carousel/index'
import Vue from 'vue'
const components = [hsLinebar, hsPie, hsRadar, hsTable, hsCarousel]

const install = function(Vue) {
  if (install.installed) return
  components.forEach(component => {
    Vue.component(component.name, component)
  })
}
const vue = (typeof window !== 'undefined' && window.Vue) || Vue
if (vue) {
  install(vue)
}

export default {
  install,
  hsLinebar,
  hsPie,
  hsRadar,
  hsTable,
  hsCarousel
}
