import './bootstrap'
import React from 'react'
import { createRoot } from 'react-dom/client'
import { createInertiaApp } from '@inertiajs/react'
import ProfileShow from './Pages/Profile/ProfileShow'
import ProfileGallery from './Pages/Profile/ProfileGallery'
import CollectionShow from './Pages/Collection/CollectionShow'
import CollectionSeriesShow from './Pages/Collection/CollectionSeriesShow'
import CollectionManage from './Pages/Collection/CollectionManage'
import CollectionFeaturedIndex from './Pages/Collection/CollectionFeaturedIndex'
import SavedCollections from './Pages/Collection/SavedCollections'

const pages = {
  'Profile/ProfileShow': ProfileShow,
  'Profile/ProfileGallery': ProfileGallery,
  'Collection/CollectionShow': CollectionShow,
  'Collection/CollectionSeriesShow': CollectionSeriesShow,
  'Collection/CollectionManage': CollectionManage,
  'Collection/CollectionFeaturedIndex': CollectionFeaturedIndex,
  'Collection/SavedCollections': SavedCollections,
}

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