feat: implement skeleton loading across all dynamic sections

Added a shimmering Skeleton component. Integrated loading states for Hero, About (Bento Grid), Reading Log, Projects Archive, and Library pages for a premium UX.
This commit is contained in:
2026-02-16 01:43:23 +01:00
parent 739ee8a825
commit 0684231308
8 changed files with 208 additions and 78 deletions

View File

@@ -5,6 +5,7 @@ import { BookOpen } from "lucide-react";
import { useEffect, useState } from "react";
import { useTranslations } from "next-intl";
import Image from "next/image";
import { Skeleton } from "./ui/Skeleton";
interface CurrentlyReading {
title: string;
@@ -54,8 +55,26 @@ const CurrentlyReading = () => {
fetchCurrentlyReading();
}, []); // Leeres Array = nur einmal beim Mount
if (loading) {
return (
<div className="space-y-4">
<div className="flex flex-col sm:flex-row gap-4 items-start">
<Skeleton className="w-24 h-36 sm:w-28 sm:h-40 rounded-lg shrink-0" />
<div className="flex-1 space-y-3 w-full">
<Skeleton className="h-6 w-3/4" />
<Skeleton className="h-4 w-1/2" />
<div className="space-y-2 pt-4">
<Skeleton className="h-2 w-full" />
<Skeleton className="h-2 w-full" />
</div>
</div>
</div>
</div>
);
}
// Zeige nichts wenn kein Buch gelesen wird oder noch geladen wird
if (loading || books.length === 0) {
if (books.length === 0) {
return null;
}