Fixed no item warning.
This commit is contained in:
@@ -121,6 +121,7 @@ export default function NavBar() {
|
||||
<SearchIcon sx={{ color: "white", mr: 1 }} />
|
||||
),
|
||||
}}
|
||||
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
@@ -149,5 +149,7 @@
|
||||
.no-results {
|
||||
text-align: center;
|
||||
font-size: 1rem;
|
||||
color: var(--text-color);
|
||||
min-width: 600px;
|
||||
background-color: grey;
|
||||
color: primary;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user