We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27ffe9f commit 70383b2Copy full SHA for 70383b2
src/pages/artworks/Favorites.tsx
@@ -20,6 +20,11 @@ export default function Artworks() {
20
const artworks = async () => {
21
setIsLoading(true);
22
try {
23
+ if (!favorites || favorites.length === 0) {
24
+ setData([]);
25
+ setIsLoading(false);
26
+ return;
27
+ }
28
const fetchResult = await fetchArtworksByIds(favorites);
29
setData(fetchResult.artworks);
30
} catch (error) {
@@ -59,7 +64,7 @@ export default function Artworks() {
59
64
<div className="flex flex-wrap justify-center gap-4 mb-4">
60
65
{data.length === 0 ? (
61
66
<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>
63
68
</div>
69
) : (
70
data
0 commit comments