forked from mongodb/docs-sample-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloading.tsx
More file actions
32 lines (27 loc) · 1008 Bytes
/
loading.tsx
File metadata and controls
32 lines (27 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import pageStyles from "./page.module.css";
import movieStyles from "./movies.module.css";
import { MovieCardSkeleton, PageSelectorSkeleton, PaginationSkeleton } from "../components/LoadingSkeleton";
/**
* Loading Component for Movies Page
*
* This component is automatically displayed by Next.js while the movies page
* is loading during Server Side Rendering or when navigating to the page.
*/
export default function Loading() {
return (
<div className={pageStyles.page}>
<main className={pageStyles.main}>
<h1 className={movieStyles.pageTitle}>Movies</h1>
<p className={movieStyles.movieCount}>Loading movies from the sample_mflix database...</p>
<PageSelectorSkeleton />
{/* Movies Grid Skeleton */}
<div className={movieStyles.moviesGrid}>
{[...Array(20)].map((_, i) => (
<MovieCardSkeleton key={i} />
))}
</div>
<PaginationSkeleton />
</main>
</div>
);
}