| 123456789101112131415161718192021222324252627282930 |
- import type { Table as ReactTable } from "@tanstack/react-table";
- import { Button } from "src/components";
- import { intl } from "src/locale";
- interface Props {
- tableInstance: ReactTable<any>;
- onNew?: () => void;
- isFiltered?: boolean;
- }
- export default function Empty({ tableInstance, onNew, isFiltered }: Props) {
- return (
- <tr>
- <td colSpan={tableInstance.getVisibleFlatColumns().length}>
- <div className="text-center my-4">
- {isFiltered ? (
- <h2>{intl.formatMessage({ id: "empty-search" })}</h2>
- ) : (
- <>
- <h2>{intl.formatMessage({ id: "proxy-hosts.empty" })}</h2>
- <p className="text-muted">{intl.formatMessage({ id: "empty-subtitle" })}</p>
- <Button className="btn-lime my-3" onClick={onNew}>
- {intl.formatMessage({ id: "proxy-hosts.add" })}
- </Button>
- </>
- )}
- </div>
- </td>
- </tr>
- );
- }
|