Homepage isLoading

This commit is contained in:
Tim
2025-06-18 23:52:32 +02:00
parent b44909c9ca
commit cce2e8c35d

View File

@@ -37,7 +37,7 @@ export default function Home() {
const [selectedCategory, setSelectedCategory] = useState<string | null>(null);
const [selectedRating, setSelectedRating] = useState<string | null>(null);
const { data = [] } = useQuery<ItemWithImage[]>({
const { data = [], isLoading } = useQuery<ItemWithImage[]>({
queryKey: ['fetchItemListWithImage'],
queryFn: fetchItemListWithImage,
retry: 3, // Versucht es 3-mal erneut
@@ -140,7 +140,6 @@ export default function Home() {
}
};
return (
<div
className="home-page-background"
@@ -171,12 +170,8 @@ export default function Home() {
className="home-page-background"
style={{ backgroundColor: theme.palette.homepage }}
>
<div className="sidebar sidebar-filter">
{/* … Sidebar mit Filtern … */}
</div>
{/* hier kommt Dein angepasster Hauptbereich */}
<main
{isLoading && t('loading')}
{!isLoading && <main
className="page-background page-background-center"
ref={containerRef}
>
@@ -202,7 +197,7 @@ export default function Home() {
))
)}
</Box>
</main>
</main>}
</div>
</div>
);