import { App, defineAsyncComponent, defineComponent } from "vue"

const modulesComponent = import.meta.glob('../components/**/**.vue');

const install = (app: App) => {
    for(const [key , value] of Object.entries(modulesComponent)) {
      const name = key.slice(key.lastIndexOf('/') + 1, key.lastIndexOf('.'));
      app.component(name, defineAsyncComponent(value))
    }
}
export default install