File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- export default function Loading ( ) {
2- return null
1+ import Image from "next/image" ;
2+
3+ interface LoadingProps {
4+ message ?: string ;
35}
6+
7+ export default function Loading ( { message } : LoadingProps = { } ) {
8+ const displayMessage = message ?? "Loading..." ;
9+
10+ return (
11+ < div className = "min-h-screen bg-gradient-to-br from-green-50 via-yellow-50 to-[#FFC517]/10 flex items-center justify-center" >
12+ < div className = "text-center" >
13+ < Image
14+ src = "/logo-animated.gif"
15+ alt = { displayMessage }
16+ width = { 80 }
17+ height = { 80 }
18+ unoptimized
19+ className = "w-20 h-20 mx-auto mb-4"
20+ />
21+ < p className = "text-gray-600" > { displayMessage } </ p >
22+ </ div >
23+ </ div >
24+ ) ;
25+ }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import BlogCard from "@/components/blog-card"
77import Pagination from "@/components/pagination"
88import Link from "next/link"
99import Footer from "@/components/footer"
10+ import Loading from "@/app/loading"
1011import type { PaginatedPosts } from "@/types/blog"
1112
1213export default function HomePage ( ) {
@@ -59,14 +60,7 @@ export default function HomePage() {
5960 )
6061
6162 if ( loading ) {
62- return (
63- < div className = "min-h-screen bg-gradient-to-br from-green-50 via-yellow-50 to-[#FFC517]/10 flex items-center justify-center" >
64- < div className = "text-center" >
65- < div className = "animate-spin rounded-full h-12 w-12 border-b-2 border-[#228B22] mx-auto mb-4" > </ div >
66- < p className = "text-gray-600" > Loading articles...</ p >
67- </ div >
68- </ div >
69- )
63+ return < Loading message = "Loading articles..." />
7064 }
7165
7266 if ( ! paginatedData ) {
You can’t perform that action at this time.
0 commit comments