import './assets/main.css'
import '@mdi/font/css/materialdesignicons.css'
import 'vuetify/styles'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import axiosInstance from '@/config/axios.ts'
import type { AxiosInstance } from 'axios'
import { registerLayouts } from '@/layouts/register.ts'

import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'

const app = createApp(App)

const vuetify = createVuetify({
  components,
  directives,
  icons: {
    defaultSet: 'mdi',
  },
  defaults: {
    global: {
      // transition: 'no',
      ripple: false,
    },
    VToolbar: { density: 'compact' },
    VRow: { dense: true },
    VSheet: { border: true, rounded: true },
    VList: { density: 'compact' },
    VCard: { variant: 'outlined' },
    VChip: { density: 'compact', variant: 'outlined', label: true },
    VNumberInput: { hideDetails: true, variant: 'outlined', density: 'compact' },
    VBtn: { variant: 'tonal', density: 'compact' },
    VTextField: { variant: 'outlined', density: 'compact', hideDetails: false },
    VSelect: { variant: 'outlined', density: 'compact', hideDetails: false },
    VTextarea: { hideDetails: true, variant: 'outlined', density: 'compact' },
  },
})

app.provide<AxiosInstance>('axios', axiosInstance)

app.use(createPinia())
app.use(router)
app.use(vuetify)

registerLayouts(app)

app.mount('#app')
