121 lines
3.9 KiB
TypeScript
121 lines
3.9 KiB
TypeScript
|
|
import { Skeleton } from "@/components/ui/skeleton";
|
||
|
|
import {
|
||
|
|
Table,
|
||
|
|
TableBody,
|
||
|
|
TableCell,
|
||
|
|
TableHead,
|
||
|
|
TableHeader,
|
||
|
|
TableRow,
|
||
|
|
} from "@/components/ui/table";
|
||
|
|
|
||
|
|
export function DataTableSkeleton() {
|
||
|
|
return (
|
||
|
|
<div className="space-y-4">
|
||
|
|
{/* Toolbar skeleton */}
|
||
|
|
<div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||
|
|
<div className="flex flex-1 items-center gap-2">
|
||
|
|
<Skeleton className="h-9 w-[300px]" />
|
||
|
|
<Skeleton className="h-9 w-[150px]" />
|
||
|
|
</div>
|
||
|
|
<div className="flex items-center gap-2">
|
||
|
|
<Skeleton className="h-9 w-[80px]" />
|
||
|
|
<Skeleton className="h-9 w-[100px]" />
|
||
|
|
<Skeleton className="h-9 w-[90px]" />
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
{/* Table skeleton */}
|
||
|
|
<div className="rounded-md border">
|
||
|
|
<Table>
|
||
|
|
<TableHeader>
|
||
|
|
<TableRow>
|
||
|
|
<TableHead className="w-[40px]">
|
||
|
|
<Skeleton className="h-4 w-4" />
|
||
|
|
</TableHead>
|
||
|
|
<TableHead>
|
||
|
|
<Skeleton className="h-4 w-20" />
|
||
|
|
</TableHead>
|
||
|
|
<TableHead>
|
||
|
|
<Skeleton className="h-4 w-24" />
|
||
|
|
</TableHead>
|
||
|
|
<TableHead>
|
||
|
|
<Skeleton className="h-4 w-16" />
|
||
|
|
</TableHead>
|
||
|
|
<TableHead>
|
||
|
|
<Skeleton className="h-4 w-14" />
|
||
|
|
</TableHead>
|
||
|
|
<TableHead>
|
||
|
|
<Skeleton className="h-4 w-20" />
|
||
|
|
</TableHead>
|
||
|
|
<TableHead>
|
||
|
|
<Skeleton className="h-4 w-24" />
|
||
|
|
</TableHead>
|
||
|
|
<TableHead>
|
||
|
|
<Skeleton className="h-4 w-16" />
|
||
|
|
</TableHead>
|
||
|
|
<TableHead>
|
||
|
|
<Skeleton className="h-4 w-16" />
|
||
|
|
</TableHead>
|
||
|
|
<TableHead className="w-[40px]" />
|
||
|
|
</TableRow>
|
||
|
|
</TableHeader>
|
||
|
|
<TableBody>
|
||
|
|
{Array.from({ length: 10 }).map((_, index) => (
|
||
|
|
<TableRow key={index}>
|
||
|
|
<TableCell>
|
||
|
|
<Skeleton className="h-4 w-4" />
|
||
|
|
</TableCell>
|
||
|
|
<TableCell>
|
||
|
|
<Skeleton className="h-4 w-16" />
|
||
|
|
</TableCell>
|
||
|
|
<TableCell>
|
||
|
|
<Skeleton className="h-4 w-32" />
|
||
|
|
</TableCell>
|
||
|
|
<TableCell>
|
||
|
|
<Skeleton className="h-4 w-24" />
|
||
|
|
</TableCell>
|
||
|
|
<TableCell>
|
||
|
|
<Skeleton className="h-6 w-16 rounded-full" />
|
||
|
|
</TableCell>
|
||
|
|
<TableCell>
|
||
|
|
<div className="flex items-center gap-2">
|
||
|
|
<Skeleton className="h-2 w-24 rounded-full" />
|
||
|
|
<Skeleton className="h-4 w-8" />
|
||
|
|
</div>
|
||
|
|
</TableCell>
|
||
|
|
<TableCell>
|
||
|
|
<Skeleton className="h-4 w-20" />
|
||
|
|
</TableCell>
|
||
|
|
<TableCell>
|
||
|
|
<Skeleton className="h-4 w-20" />
|
||
|
|
</TableCell>
|
||
|
|
<TableCell>
|
||
|
|
<Skeleton className="h-4 w-20" />
|
||
|
|
</TableCell>
|
||
|
|
<TableCell>
|
||
|
|
<Skeleton className="h-8 w-8" />
|
||
|
|
</TableCell>
|
||
|
|
</TableRow>
|
||
|
|
))}
|
||
|
|
</TableBody>
|
||
|
|
</Table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
{/* Pagination skeleton */}
|
||
|
|
<div className="flex items-center justify-between px-2">
|
||
|
|
<Skeleton className="h-4 w-[200px]" />
|
||
|
|
<div className="flex items-center space-x-6">
|
||
|
|
<Skeleton className="h-4 w-[150px]" />
|
||
|
|
<Skeleton className="h-4 w-[100px]" />
|
||
|
|
<div className="flex items-center space-x-2">
|
||
|
|
<Skeleton className="h-8 w-8" />
|
||
|
|
<Skeleton className="h-8 w-8" />
|
||
|
|
<Skeleton className="h-8 w-8" />
|
||
|
|
<Skeleton className="h-8 w-8" />
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
}
|