import type { App, Component } from 'vue'
const setupComponent = async (app: App) => {
  const components = import.meta.glob<
    Component & {
      __name: string
    }
  >('./**/*.vue', {
    import: 'default',
    eager: true,
  })
  for (const path in components) {
    app.component(
      components[path as keyof typeof components].__name!,
      components[path as keyof typeof components],
    )
  }
}
export default setupComponent
