import React from 'react';
import { createBrowserRouter } from 'react-router-dom';
import HomeScreen from './screens/HomeScreen';
import GalleryScreen from './screens/GalleryScreen';
import PhotoLightboxScreen from './screens/PhotoLightboxScreen';
import TasksScreen from './screens/TasksScreen';
import TaskDetailScreen from './screens/TaskDetailScreen';
import SettingsScreen from './screens/SettingsScreen';
import UploadScreen from './screens/UploadScreen';
import UploadQueueScreen from './screens/UploadQueueScreen';
import ShareScreen from './screens/ShareScreen';
import AchievementsScreen from './screens/AchievementsScreen';
import NotFoundScreen from './screens/NotFoundScreen';
import LandingScreen from './screens/LandingScreen';
import ProfileSetupScreen from './screens/ProfileSetupScreen';
import LegalScreen from './screens/LegalScreen';
import HelpCenterScreen from './screens/HelpCenterScreen';
import HelpArticleScreen from './screens/HelpArticleScreen';
import PublicGalleryScreen from './screens/PublicGalleryScreen';
import SharedPhotoScreen from './screens/SharedPhotoScreen';
import LiveShowScreen from './screens/LiveShowScreen';
import SlideshowScreen from './screens/SlideshowScreen';
import EventLayout from './layouts/EventLayout';
import GuestLocaleLayout from './layouts/GuestLocaleLayout';
import MockupsIndexScreen from './screens/mockups/MockupsIndexScreen';
import MockupsHomeIndexScreen from './screens/mockups/MockupsHomeIndexScreen';
import Mockup01CaptureOrbit from './screens/mockups/Mockup01CaptureOrbit';
import Mockup02GalleryMosaic from './screens/mockups/Mockup02GalleryMosaic';
import Mockup03PromptQuest from './screens/mockups/Mockup03PromptQuest';
import Mockup04TimelineStream from './screens/mockups/Mockup04TimelineStream';
import Mockup05CompassHub from './screens/mockups/Mockup05CompassHub';
import Mockup06SplitCapture from './screens/mockups/Mockup06SplitCapture';
import Mockup07SwipeDeck from './screens/mockups/Mockup07SwipeDeck';
import Mockup08Daybook from './screens/mockups/Mockup08Daybook';
import Mockup09ChecklistFlow from './screens/mockups/Mockup09ChecklistFlow';
import Mockup10SpotlightReel from './screens/mockups/Mockup10SpotlightReel';
import MockupHome01PulseHero from './screens/mockups/MockupHome01PulseHero';
import MockupHome02StoryRings from './screens/mockups/MockupHome02StoryRings';
import MockupHome03LiveStream from './screens/mockups/MockupHome03LiveStream';
import MockupHome04TaskSprint from './screens/mockups/MockupHome04TaskSprint';
import MockupHome05GalleryFirst from './screens/mockups/MockupHome05GalleryFirst';
import MockupHome06CalmFocus from './screens/mockups/MockupHome06CalmFocus';
import MockupHome07MomentStack from './screens/mockups/MockupHome07MomentStack';
import MockupHome08CountdownStage from './screens/mockups/MockupHome08CountdownStage';
import MockupHome09ShareHub from './screens/mockups/MockupHome09ShareHub';
import MockupHome10Moodboard from './screens/mockups/MockupHome10Moodboard';

const screenChildren = [
  { index: true, element: <HomeScreen /> },
  { path: 'gallery', element: <GalleryScreen /> },
  { path: 'photo/:photoId', element: <PhotoLightboxScreen /> },
  { path: 'tasks', element: <TasksScreen /> },
  { path: 'tasks/:taskId', element: <TaskDetailScreen /> },
  { path: 'upload', element: <UploadScreen /> },
  { path: 'queue', element: <UploadQueueScreen /> },
  { path: 'share', element: <ShareScreen /> },
  { path: 'achievements', element: <AchievementsScreen /> },
  { path: 'settings', element: <SettingsScreen /> },
  { path: 'help', element: <HelpCenterScreen /> },
  { path: 'help/:slug', element: <HelpArticleScreen /> },
  { path: 'slideshow', element: <SlideshowScreen /> },
];

export const router = createBrowserRouter(
  [
    {
      element: <GuestLocaleLayout />,
      children: [
        { path: '/event', element: <LandingScreen /> },
        { path: '/event-v2', element: <LandingScreen /> },
        { path: '/legal/:page', element: <LegalScreen /> },
        { path: '/help', element: <HelpCenterScreen /> },
        { path: '/help/:slug', element: <HelpArticleScreen /> },
        { path: '/g/:token', element: <PublicGalleryScreen /> },
        { path: '/share/:slug', element: <SharedPhotoScreen /> },
      ],
    },
    { path: '/setup/:token', element: <EventLayout tasksEnabledFallback />, children: [{ index: true, element: <ProfileSetupScreen /> }] },
    { path: '/e/:token', element: <EventLayout tasksEnabledFallback={false} requireProfile />, children: screenChildren },
    { path: '/show/:token', element: <EventLayout tasksEnabledFallback={false} />, children: [{ index: true, element: <LiveShowScreen /> }] },
    { path: '/mockups', element: <MockupsIndexScreen /> },
    { path: '/mockups/1', element: <Mockup01CaptureOrbit /> },
    { path: '/mockups/2', element: <Mockup02GalleryMosaic /> },
    { path: '/mockups/3', element: <Mockup03PromptQuest /> },
    { path: '/mockups/4', element: <Mockup04TimelineStream /> },
    { path: '/mockups/5', element: <Mockup05CompassHub /> },
    { path: '/mockups/6', element: <Mockup06SplitCapture /> },
    { path: '/mockups/7', element: <Mockup07SwipeDeck /> },
    { path: '/mockups/8', element: <Mockup08Daybook /> },
    { path: '/mockups/9', element: <Mockup09ChecklistFlow /> },
    { path: '/mockups/10', element: <Mockup10SpotlightReel /> },
    { path: '/mockups/home', element: <MockupsHomeIndexScreen /> },
    { path: '/mockups/home/1', element: <MockupHome01PulseHero /> },
    { path: '/mockups/home/2', element: <MockupHome02StoryRings /> },
    { path: '/mockups/home/3', element: <MockupHome03LiveStream /> },
    { path: '/mockups/home/4', element: <MockupHome04TaskSprint /> },
    { path: '/mockups/home/5', element: <MockupHome05GalleryFirst /> },
    { path: '/mockups/home/6', element: <MockupHome06CalmFocus /> },
    { path: '/mockups/home/7', element: <MockupHome07MomentStack /> },
    { path: '/mockups/home/8', element: <MockupHome08CountdownStage /> },
    { path: '/mockups/home/9', element: <MockupHome09ShareHub /> },
    { path: '/mockups/home/10', element: <MockupHome10Moodboard /> },
    { path: '*', element: <NotFoundScreen /> },
  ],
  {}
);
