diff --git a/src/components/ui/AppDialog.tsx b/src/components/ui/AppDialog.tsx index ff06379a..c88bd9fe 100644 --- a/src/components/ui/AppDialog.tsx +++ b/src/components/ui/AppDialog.tsx @@ -6,7 +6,6 @@ import { DialogFooter, } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; -import { X } from "lucide-react"; import { ReactNode } from "react"; type AppDialogProps = { @@ -43,16 +42,8 @@ export function AppDialog({ return ( !o && onClose()}> - + {title} -
{children}
diff --git a/src/components/ui/DataTable.tsx b/src/components/ui/DataTable.tsx index c6883fa7..1373585c 100644 --- a/src/components/ui/DataTable.tsx +++ b/src/components/ui/DataTable.tsx @@ -10,6 +10,7 @@ import { } from "@/components/ui/table"; import { Card, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; +import { Skeleton } from "@/components/ui/skeleton"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { ReactNode } from "react"; import { usePathname, useRouter, useSearchParams } from "next/navigation"; @@ -77,7 +78,7 @@ function PaginationBar({ page, perPage, total }: { page: number; perPage: number } function DesktopTable({ - columns, data, keyField, emptyMessage, onRowClick, isEmpty, + columns, data, keyField, emptyMessage, onRowClick, isEmpty, loading, }: { columns: Column[]; data: T[]; @@ -85,6 +86,7 @@ function DesktopTable({ emptyMessage: string; onRowClick?: (row: T) => void; isEmpty: boolean; + loading?: boolean; }) { return (
@@ -103,7 +105,17 @@ function DesktopTable({ - {isEmpty ? ( + {loading ? ( + Array.from({ length: 5 }).map((_, i) => ( + + {columns.map((col) => ( + + + + ))} + + )) + ) : isEmpty ? ( {emptyMessage} @@ -149,7 +161,13 @@ export function DataTable({ return (
- {isEmpty ? ( + {loading ? ( +
+ {Array.from({ length: 3 }).map((_, i) => ( + + ))} +
+ ) : isEmpty ? ( {emptyMessage} @@ -168,7 +186,7 @@ export function DataTable({ {pagination && }
@@ -181,7 +199,7 @@ export function DataTable({ {pagination && }