feat(tables): integrate EmptyListWrapper component for improved empty state handling
- Add EmptyListWrapper to various tables (Admins, Companies, Customers, Feedback, Notification History, Tenders) to provide a consistent empty state message when no data is available. - Update phone number and status display logic in the Profile page to handle null values gracefully. - Introduce worktree setup configuration in worktrees.json for easier project setup.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
import { EyeIcon } from "@/assets/icons";
|
||||
import EmptyListWrapper from "@/components/HOC/EmptyListWrapper";
|
||||
import { ShowcaseSection } from "@/components/Layouts/showcase-section";
|
||||
import Pagination from "@/components/ui/pagination";
|
||||
import Status from "@/components/ui/Status";
|
||||
@@ -60,14 +61,12 @@ const NotificationHistoryTable = () => {
|
||||
</TableHeader>
|
||||
{isLoading && <TableSkeleton column={columns.length} />}
|
||||
<TableBody>
|
||||
{!notificationHistory?.length ? (
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<h2>No notifications</h2>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : (
|
||||
notificationHistory.map((item, index) => (
|
||||
<EmptyListWrapper
|
||||
list={notificationHistory ?? []}
|
||||
columns={columns}
|
||||
emptyMessage="No notifications were found"
|
||||
>
|
||||
{(notificationHistory ?? []).map((item, index) => (
|
||||
<TableRow key={item.id}>
|
||||
<TableCell colSpan={100}>{index + 1}</TableCell>
|
||||
<TableCell colSpan={100}>{item.title}</TableCell>
|
||||
@@ -114,8 +113,8 @@ const NotificationHistoryTable = () => {
|
||||
</button>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))
|
||||
)}
|
||||
))}
|
||||
</EmptyListWrapper>
|
||||
</TableBody>
|
||||
</Table>
|
||||
<Pagination
|
||||
|
||||
Reference in New Issue
Block a user