More react

- consolidated lang items
- proxy host paths work
This commit is contained in:
Jamie Curnow
2025-10-16 18:59:19 +10:00
parent 7af01d0fc7
commit f2b5b19a83
56 changed files with 946 additions and 928 deletions

View File

@@ -0,0 +1,48 @@
import type { Table as ReactTable } from "@tanstack/react-table";
import cn from "classnames";
import type { ReactNode } from "react";
import { Button } from "src/components";
import { T } from "src/locale";
interface Props {
tableInstance: ReactTable<any>;
onNew?: () => void;
isFiltered?: boolean;
object: string;
objects: string;
color?: string;
customAddBtn?: ReactNode;
}
function EmptyData({ tableInstance, onNew, isFiltered, object, objects, color = "primary", customAddBtn }: Props) {
return (
<tr>
<td colSpan={tableInstance.getVisibleFlatColumns().length}>
<div className="text-center my-4">
{isFiltered ? (
<h2>
<T id="empty-search" />
</h2>
) : (
<>
<h2>
<T id="object.empty" tData={{ objects }} />
</h2>
<p className="text-muted">
<T id="empty-subtitle" />
</p>
{customAddBtn ? (
customAddBtn
) : (
<Button className={cn("my-3", `btn-${color}`)} onClick={onNew}>
<T id="object.add" tData={{ object }} />
</Button>
)}
</>
)}
</div>
</td>
</tr>
);
}
export { EmptyData };