File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import { placeholderGames } from "@/placeholderData";
1212import { Button } from "../components/ui/button" ;
1313
1414export default function Landing ( ) {
15- const { data, isPending, isError } = useEvents ( {
15+ const { data, isPending, isError, isFetching } = useEvents ( {
1616 type : "upcoming" ,
1717 pageSize : 100 ,
1818 } ) ;
@@ -147,8 +147,20 @@ export default function Landing() {
147147 </ section >
148148
149149 < section className = "bg-background px-10 py-20" >
150+ { isFetching && ! isPending && (
151+ < span className = "text-sm text-gray-400" > Loading...</ span >
152+ ) }
153+
154+ { isPending && < p > Loading events...</ p > }
155+
156+ { isError && (
157+ < p className = "text-red-500" role = "alert" >
158+ Failed to load events.
159+ </ p >
160+ ) }
150161 { ! isPending && ! isError && < EventCarousel items = { events ?? [ ] } /> }
151162 </ section >
163+
152164 { /* Leaving commented out until styling/design is confirmed. */ }
153165 { /* <section className="bg-background px-4 py-10 md:px-10">
154166 <div className="flex w-full px-4">
You can’t perform that action at this time.
0 commit comments