Skip to content

Commit 70383b2

Browse files
committed
i wanna show u something
1 parent 27ffe9f commit 70383b2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/pages/artworks/Favorites.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export default function Artworks() {
2020
const artworks = async () => {
2121
setIsLoading(true);
2222
try {
23+
if (!favorites || favorites.length === 0) {
24+
setData([]);
25+
setIsLoading(false);
26+
return;
27+
}
2328
const fetchResult = await fetchArtworksByIds(favorites);
2429
setData(fetchResult.artworks);
2530
} catch (error) {
@@ -59,7 +64,7 @@ export default function Artworks() {
5964
<div className="flex flex-wrap justify-center gap-4 mb-4">
6065
{data.length === 0 ? (
6166
<div className="flex items-center justify-center h-64">
62-
<p className="text-gray-500">No results found.</p>
67+
<p className="text-gray-500">No favorites found.</p>
6368
</div>
6469
) : (
6570
data

0 commit comments

Comments
 (0)