import { createApp } from 'vue';

import * as Sentry from '@sentry/vue';
import { VueQueryPlugin } from '@tanstack/vue-query';
import * as VtjCharts from '@vtj/charts';
import { IconsPlugin } from '@vtj/icons';
import * as VtjUI from '@vtj/ui';
import ElementPlus from 'element-plus';

import App from './App.vue';

import 'element-plus/dist/index.css';
import '@vtj/ui/dist/style.css';

const app = createApp(App);

Sentry.init({
  app,
  dsn: 'https://5bcf1344794fea64fc5e5fe7da4821c1@o4508962650783744.ingest.de.sentry.io/4508962653143120',
});

// 批量注册组件
Object.entries(VtjUI).forEach(([name, component]) => {
  app.component(name, component);
});
Object.entries(VtjCharts).forEach(([name, component]) => {
  app.component(name, component);
});
app
  .use(ElementPlus)
  .use(IconsPlugin)
  .use(VueQueryPlugin)
  .mount('#y-code-renderer');
