# Pages All pages are **lazy-loaded** via `React.lazy()` with per-route skeleton fallbacks. Each page fetches data through React Query hooks. --- ## `HomePage` **File:** `src/pages/HomePage.tsx` · **Route:** `/` Landing page with hero carousel and TMDB browse grids. - **TrendingSlider** — auto-rotating top-10 hero banner - **Search bar** — debounced (400 ms); switches between search results and browse mode - **Browse sections:** Trending, Popular, Top Rated, Upcoming (each as `TrendingGrid`) - Pre-loads library on mount via `useLibrary()` --- ## `DashboardPage` **File:** `src/pages/DashboardPage.tsx` · **Route:** `/dashboard` Statistics overview with summary cards and charts. - **Stats cards:** Movies count, TV count, Favourites, Watchlist, Total watch time - **Charts:** WatchActivityChart, WatchTimeChart, RatingsChart, TopGenresChart, CouchDayChart, MediaTypeChart, LibraryGrowthChart - **Recently Watched:** grid of 14 entries sorted by `date_last_seen` descending - Year selector controls for time-scoped charts --- ## `LibraryPage` **File:** `src/pages/LibraryPage.tsx` · **Route:** `/library` Filterable and sortable library grid. - **Tabs:** All / Movies / TV / Favourites / Hidden - **Search:** debounced text search - **Filters:** Genre, Rating range, Year range (via popovers) - **Sort:** Last Watched, Date Added, Title, Release Date, Rating - **Pagination:** 28 items per page with "Load More" button - Responsive: stacked controls on mobile, inline on desktop --- ## `WatchlistPage` **File:** `src/pages/WatchlistPage.tsx` · **Route:** `/watchlist` Similar to LibraryPage but filtered to entries with `watchlist: true`. --- ## `CollectionsPage` **File:** `src/pages/CollectionsPage.tsx` · **Route:** `/collections` - **Tabs:** All / Official (TMDB) / Custom (user-created) - Search by collection name - Grid of `CollectionsGrid` cards (2–6 cols) --- ## `CollectionDetailsPage` **File:** `src/pages/CollectionDetailsPage.tsx` · **Route:** `/collections/:id` Single collection view. - Hero banner with backdrop - Poster, name, description, entry count, user rating - Entry grid (`EntryLibraryGrid`) - Edit button → `CollectionEditDialog` --- ## `MediaPage` **File:** `src/pages/MediaPage.tsx` · **Route:** `/media` Custom media gallery. - **Tabs:** All / Posters / Backdrops / Logos - Search by entry title - Responsive grid (1–6 cols; backdrops as `aspect-video`) --- ## `CalendarPage` **File:** `src/pages/CalendarPage.tsx` · **Route:** `/calendar` Monthly calendar for upcoming episode air dates. - Monthly grid layout - Episodes grouped by air date (up to 4 per day cell) - Navigation: previous / next month buttons - Today highlighted with primary colour - Episode items show poster thumbnail + S##E## label - Tooltip with full episode info --- ## `EntryDetailsPage` **File:** `src/pages/EntryDetailsPage.tsx` · **Route:** `/entry/:id` Full entry detail page. - **Hero:** blurred backdrop banner with gradient overlay - **Sticky poster** on left side - **Metadata:** title, year, runtime, rating, type badge, genres - **Description / storyline** - **Actions:** Favourite toggle, Mark Watched dropdown, Rate, Watch History (movies), Hide/Unhide, Refresh, Add to Collection, Manage Media, Settings - **Sections:** Cast list, Seasons (TV series), Watch history, Collections --- ## `SeasonPage` **File:** `src/pages/SeasonPage.tsx` · **Route:** `/entry/:entryId/season/:seasonId` Season detail with episode list. - Poster + season header - Progress bar (watched / total episodes) - "Mark Season Watched" button - Episode list: number, name, air date, runtime, ratings, watch status badge - Mark individual episodes as watched - Links to episode detail pages --- ## `EpisodePage` **File:** `src/pages/EpisodePage.tsx` · **Route:** `/entry/:entryId/season/:seasonId/episode/:episodeId` Single episode detail. - Still image (or poster fallback) - Metadata: episode number, air date, runtime - Description / overview - Guest stars (cast list) - Watch history - Back-links to season and entry --- ## `DiscoverPage` **File:** `src/pages/DiscoverPage.tsx` · **Route:** `/discover/:category` TMDB category browsing with infinite scroll. - Category from URL param: `trending`, `popular`, `top-rated`, `upcoming` - Tab: Movies / TV (hidden for `upcoming`) - Infinite pagination via `useInfiniteQuery` - `EntryCard` grid --- ## `PeoplePage` **File:** `src/pages/PeoplePage.tsx` · **Route:** `/people` People search and discovery. - Search from TMDB Popular or search query - Infinite scroll pagination - Avatar grid (3–8 cols) - Links to person detail pages --- ## `PersonDetailsPage` **File:** `src/pages/PersonDetailsPage.tsx` · **Route:** `/people/:id` Person biography and filmography. - Profile photo + biographical info - Known-for department - Filmography: Cast credits + Crew credits - Links to entry detail pages --- ## `PersonTmdbRedirectPage` **File:** `src/pages/PersonTmdbRedirectPage.tsx` · **Route:** `/people/tmdb/:tmdbId` Intermediate page that fetches a person from TMDB by ID, creates a local record if needed, then redirects to `/people/:id`. --- ## `SettingsPage` **File:** `src/pages/SettingsPage.tsx` · **Route:** `/settings` Application settings form. - Fields: TMDB API Key, Backend Port - Zod validation - Save button with loading state