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 StudioCalendar from './Pages/Studio/StudioCalendar'
import StudioContentIndex from './Pages/Studio/StudioContentIndex'
import StudioArtworks from './Pages/Studio/StudioArtworks'
import StudioDrafts from './Pages/Studio/StudioDrafts'
import StudioInbox from './Pages/Studio/StudioInbox'
import StudioScheduled from './Pages/Studio/StudioScheduled'
import StudioArchived from './Pages/Studio/StudioArchived'
import StudioArtworkAnalytics from './Pages/Studio/StudioArtworkAnalytics'
import StudioArtworkEdit from './Pages/Studio/StudioArtworkEdit'
import StudioAnalytics from './Pages/Studio/StudioAnalytics'
import StudioChallenges from './Pages/Studio/StudioChallenges'
import StudioSearch from './Pages/Studio/StudioSearch'
import StudioCardsIndex from './Pages/Studio/StudioCardsIndex'
import StudioCardEditor from './Pages/Studio/StudioCardEditor'
import StudioCardAnalytics from './Pages/Studio/StudioCardAnalytics'
import StudioCollections from './Pages/Studio/StudioCollections'
import StudioStories from './Pages/Studio/StudioStories'
import StudioAssets from './Pages/Studio/StudioAssets'
import StudioActivity from './Pages/Studio/StudioActivity'
import StudioComments from './Pages/Studio/StudioComments'
import StudioFollowers from './Pages/Studio/StudioFollowers'
import StudioGrowth from './Pages/Studio/StudioGrowth'
import StudioPreferences from './Pages/Studio/StudioPreferences'
import StudioProfile from './Pages/Studio/StudioProfile'
import StudioFeatured from './Pages/Studio/StudioFeatured'
import StudioSettings from './Pages/Studio/StudioSettings'

const pages = {
  'Studio/StudioDashboard': StudioDashboard,
  'Studio/StudioCalendar': StudioCalendar,
  'Studio/StudioContentIndex': StudioContentIndex,
  'Studio/StudioArtworks': StudioArtworks,
  'Studio/StudioDrafts': StudioDrafts,
  'Studio/StudioInbox': StudioInbox,
  'Studio/StudioScheduled': StudioScheduled,
  'Studio/StudioArchived': StudioArchived,
  'Studio/StudioArtworkAnalytics': StudioArtworkAnalytics,
  'Studio/StudioArtworkEdit': StudioArtworkEdit,
  'Studio/StudioAnalytics': StudioAnalytics,
  'Studio/StudioChallenges': StudioChallenges,
  'Studio/StudioSearch': StudioSearch,
  'Studio/StudioCardsIndex': StudioCardsIndex,
  'Studio/StudioCardEditor': StudioCardEditor,
  'Studio/StudioCardAnalytics': StudioCardAnalytics,
  'Studio/StudioCollections': StudioCollections,
  'Studio/StudioStories': StudioStories,
  'Studio/StudioAssets': StudioAssets,
  'Studio/StudioActivity': StudioActivity,
  'Studio/StudioComments': StudioComments,
  'Studio/StudioFollowers': StudioFollowers,
  'Studio/StudioGrowth': StudioGrowth,
  'Studio/StudioPreferences': StudioPreferences,
  'Studio/StudioProfile': StudioProfile,
  'Studio/StudioFeatured': StudioFeatured,
  'Studio/StudioSettings': StudioSettings,
}

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