mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 11:21:18 +00:00
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import { Table } from "@mantine/core";
|
|
import { Table as TanstackTable } from "@tanstack/react-table";
|
|
|
|
import { Button } from "../button";
|
|
|
|
export function DataTableError({
|
|
table,
|
|
message,
|
|
description,
|
|
onRetry,
|
|
}: {
|
|
table: TanstackTable<any>;
|
|
message?: string;
|
|
description?: string;
|
|
onRetry?: () => void;
|
|
}) {
|
|
return (
|
|
<Table.Tr>
|
|
<Table.Td colSpan={table.getVisibleFlatColumns().length}>
|
|
<div className="flex items-center my-6 justify-center">
|
|
<div className="text-center">
|
|
<div className="my-4">
|
|
<h2 className="text-xl font-semibold ">
|
|
{message ?? "No results"}
|
|
</h2>
|
|
<p className="mt-2 text-sm text-secondary-foreground">
|
|
{description ?? "No results found"}
|
|
</p>
|
|
</div>
|
|
{onRetry && (
|
|
<Button variant={"outline"} onClick={onRetry}>
|
|
Retry
|
|
</Button>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</Table.Td>
|
|
</Table.Tr>
|
|
);
|
|
}
|