Fixed no item warning.

This commit is contained in:
FlorianSpeicher
2025-06-03 22:35:01 +02:00
parent 804e9c02ac
commit 0b4546aacb
3 changed files with 6 additions and 9 deletions

View File

@@ -121,6 +121,7 @@ export default function NavBar() {
<SearchIcon sx={{ color: "white", mr: 1 }} />
),
}}
/>
)}
/>

View File

@@ -1,4 +1,4 @@
import { Box, Typography } from "@mui/material";
import { Alert, Box } from "@mui/material";
import { useQuery } from "@tanstack/react-query";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
@@ -215,19 +215,13 @@ export default function Home() {
<div className="page-background" ref={containerRef}>
<Box className="cardgrid">
{visibleItems.length === 0 ? (
<p className="no-results">{t('noItemsFound')}</p>
<Alert variant="filled" severity="warning" className="no-results">{t('noItemsFound')}</Alert>
) : (
visibleItems.map((item) => (
<ItemCard key={item.id} item={item} />
))
)}
</Box>
{/* Loader für Intersection Observer */}
<div ref={loaderRef} className="loader-container">
<Typography>Im Moment keine Items verfpgbar</Typography>
</div>
</div>
</div>
);

View File

@@ -149,5 +149,7 @@
.no-results {
text-align: center;
font-size: 1rem;
color: var(--text-color);
min-width: 600px;
background-color: grey;
color: primary;
}