/* eslint-disable react-refresh/only-export-components */ import { lazy, type ReactElement } from 'react' import { Navigate } from 'react-router-dom' const HomePage = lazy(() => import('./pages/HomePage').then((m) => ({ default: m.HomePage }))) const LibraryPage = lazy(() => import('./pages/LibraryPage').then((m) => ({ default: m.LibraryPage }))) const LibrariesPage = lazy(() => import('./pages/LibrariesPage').then((m) => ({ default: m.LibrariesPage }))) const FavouritesPage = lazy(() => import('./pages/FavouritesPage').then((m) => ({ default: m.FavouritesPage }))) const PlaylistsPage = lazy(() => import('./pages/PlaylistsPage').then((m) => ({ default: m.PlaylistsPage }))) const PlaylistDetailPage = lazy(() => import('./pages/PlaylistDetailPage').then((m) => ({ default: m.PlaylistDetailPage })), ) const MediaDetailPage = lazy(() => import('./pages/MediaDetailPage').then((m) => ({ default: m.MediaDetailPage }))) const PlayerPage = lazy(() => import('./pages/PlayerPage').then((m) => ({ default: m.PlayerPage }))) const AdminPage = lazy(() => import('./pages/AdminPage').then((m) => ({ default: m.AdminPage }))) const ProfilePage = lazy(() => import('./pages/ProfilePage').then((m) => ({ default: m.ProfilePage }))) const DlnaPage = lazy(() => import('./pages/DlnaPage').then((m) => ({ default: m.DlnaPage }))) const FileManagerPage = lazy(() => import('./pages/FileManagerPage').then((m) => ({ default: m.FileManagerPage })), ) const WatchHistoryPage = lazy(() => import('./pages/WatchHistoryPage').then((m) => ({ default: m.WatchHistoryPage })), ) const PosterWallPage = lazy(() => import('./pages/PosterWallPage').then((m) => ({ default: m.PosterWallPage }))) const ProfileManagementPage = lazy(() => import('./pages/ProfileManagementPage').then((m) => ({ default: m.ProfileManagementPage })), ) const SettingsPage = lazy(() => import('./pages/SettingsPage').then((m) => ({ default: m.SettingsPage }))) const StrmManagePage = lazy(() => import('./pages/StrmManagePage').then((m) => ({ default: m.StrmManagePage }))) const StrmDownloadQueuePage = lazy(() => import('./pages/StrmQueuePage').then((m) => ({ default: m.StrmDownloadQueuePage })), ) const StrmUploadQueuePage = lazy(() => import('./pages/StrmQueuePage').then((m) => ({ default: m.StrmUploadQueuePage })), ) export type AppRoute = { path?: string index?: boolean element: ReactElement adminOnly?: boolean } export const appRoutes: AppRoute[] = [ { index: true, element: }, { path: 'libraries', element: }, { path: 'library/:id', element: }, { path: 'favourites', element: }, { path: 'playlists', element: }, { path: 'playlist/:id', element: }, { path: 'media/:id', element: }, { path: 'play/:id', element: }, { path: 'profile', element: }, { path: 'dlna', element: }, { path: 'history', element: }, { path: 'poster-wall', element: }, { path: 'play-profiles', element: }, { path: 'api-configs', element: }, { path: 'tools', element: }, { path: 'files', element: , adminOnly: true }, { path: 'settings', element: , adminOnly: true }, { path: 'strm', element: , adminOnly: true }, { path: 'strm/downloads', element: , adminOnly: true }, { path: 'strm/uploads', element: , adminOnly: true }, { path: 'admin', element: , adminOnly: true }, ]