diff --git a/src/app/components/mii-list/index.tsx b/src/app/components/mii-list/index.tsx index d132cc7..a9ca06f 100644 --- a/src/app/components/mii-list/index.tsx +++ b/src/app/components/mii-list/index.tsx @@ -9,6 +9,7 @@ import Carousel from "../carousel"; import LikeButton from "../like-button"; import FilterSelect from "./filter-select"; import Pagination from "./pagination"; +import Skeleton from "./skeleton"; interface Props { isLoggedIn: boolean; @@ -106,9 +107,9 @@ export default function MiiList({ isLoggedIn, userId }: Props) { {mii.name} -
+
{mii.tags.map((tag) => ( - + {tag} ))} @@ -130,8 +131,15 @@ export default function MiiList({ isLoggedIn, userId }: Props) { ) : (

No results found.

) + ) : error ? ( +

Error: {error}

) : ( - <>{error &&

Error: {error}

} + // Show skeleton when data is loading +
+ {Array.from({ length: 24 }).map((_, i) => ( + + ))} +
)} {data && } diff --git a/src/app/components/mii-list/skeleton.tsx b/src/app/components/mii-list/skeleton.tsx new file mode 100644 index 0000000..1af63ae --- /dev/null +++ b/src/app/components/mii-list/skeleton.tsx @@ -0,0 +1,28 @@ +export default function Skeleton() { + return ( +
+ {/* Carousel Skeleton */} +
+
+
+ + {/* Content */} +
+ {/* Name */} +
+ + {/* Tags */} +
+
+
+
+ + {/* Bottom row */} +
+
+
+
+
+
+ ); +}