import { createApp, h } from 'vue'
import { createInertiaApp } from '@inertiajs/vue3'
import '@/css/app.css'

const appName = '{{ project_name.title() }}'

createInertiaApp({
  title: (title) => `${title} - ${appName}`,
  resolve: (name) => {
    const pages = import.meta.glob('./pages/**/page.vue', { eager: true })
    return pages[`./pages/${name}/page.vue`]
  },
  setup({ el, App, props, plugin }) {
    return createApp({ render: () => h(App, props) })
      .use(plugin)
      .mount(el)
  },
  progress: {
    color: '#4B5563',
  },
})