import './bootstrap'
import React from 'react'
import { createRoot } from 'react-dom/client'
import { createInertiaApp } from '@inertiajs/react'

// Eagerly import all Studio pages
import StudioDashboard from './Pages/Studio/StudioDashboard'
import StudioArtworks from './Pages/Studio/StudioArtworks'
import StudioDrafts from './Pages/Studio/StudioDrafts'
import StudioArchived from './Pages/Studio/StudioArchived'
import StudioArtworkAnalytics from './Pages/Studio/StudioArtworkAnalytics'
import StudioArtworkEdit from './Pages/Studio/StudioArtworkEdit'
import StudioAnalytics from './Pages/Studio/StudioAnalytics'

const pages = {
  'Studio/StudioDashboard': StudioDashboard,
  'Studio/StudioArtworks': StudioArtworks,
  'Studio/StudioDrafts': StudioDrafts,
  'Studio/StudioArchived': StudioArchived,
  'Studio/StudioArtworkAnalytics': StudioArtworkAnalytics,
  'Studio/StudioArtworkEdit': StudioArtworkEdit,
  'Studio/StudioAnalytics': StudioAnalytics,
}

createInertiaApp({
  resolve: (name) => pages[name],
  setup({ el, App, props }) {
    const root = createRoot(el)
    root.render(<App {...props} />)
  },
})
