import '../css/app.css';
import { createApp, h } from 'vue';
import { createInertiaApp } from '@inertiajs/vue3';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';

const basePath = '/storesight';

createInertiaApp({
    title: (title) => title ? `${title} - StoreSight AI` : 'StoreSight AI',
    resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')),
    setup({ el, App, props, plugin }) {
        const app = createApp({ render: () => h(App, props) });
        app.config.globalProperties.$url = (path) => basePath + path;
        app.use(plugin).mount(el);
        return app;
    },
    progress: {
        color: '#4F46E5',
    },
});
