Skip to content

Commit d5ecbea

Browse files
committed
fix: show EmptyState when no papers found
1 parent 0d85ce8 commit d5ecbea

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

src/components/CatalogueContent.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import type { ICourses } from "@/interface";
2525
import JSZip from "jszip";
2626
import { toast } from "react-hot-toast";
2727
import { useCourses } from "@/context/courseContext";
28+
import EmptyState from "./ui/EmptyState";
2829

2930
const CatalogueContent = () => {
3031
const router = useRouter();
@@ -440,7 +441,9 @@ const CatalogueContent = () => {
440441
/>
441442
))
442443
) : (
443-
<p>No papers available with the applied filter</p>
444+
<div className="col-span-full flex justify-center">
445+
<EmptyState />
446+
</div>
444447
)
445448
) : (
446449
papers.map((paper: IPaper) => (

src/components/ui/EmptyState.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { FileSearch } from "lucide-react";
2+
3+
export default function EmptyState() {
4+
return (
5+
<div className="flex flex-col items-center justify-center py-20 text-center">
6+
<FileSearch className="w-16 h-16 text-gray-500 mb-4" />
7+
<h2 className="text-2xl font-semibold text-gray-200">
8+
No Papers Found
9+
</h2>
10+
<p className="text-gray-400 mt-2 max-w-md">
11+
Looks like there are no papers for the filters you’ve applied.
12+
Try resetting your filters to see all available papers.
13+
</p>
14+
</div>
15+
);
16+
}

0 commit comments

Comments
 (0)