import './packages/stores/index.mjs';
import { directive } from './packages/directive/index.mjs';
import { setupVXETable } from './packages/hooks/setupVXETableHook.mjs';
import './packages/components/index.mjs';
import pinia from './packages/stores/inpinia.mjs';
import { elSvg } from './packages/components/svgIcon/index.mjs';

const makeInstaller = (components = []) => {
  const install = (app) => {
    app.use(pinia);
    components.forEach(
      (component) => {
        if (!app._context.components[component.name]) {
          app.component(component.name, component);
        }
      }
    );
    elSvg(app);
    directive(app);
    setupVXETable(app);
  };
  return {
    install
  };
};

export { makeInstaller };
