mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 23:57:12 +01:00
Updated data table render check.
This commit is contained in:
parent
3c27f08a97
commit
90bd72cf98
4 changed files with 27 additions and 2 deletions
|
|
@ -1,10 +1,21 @@
|
|||
import DataTable from 'components/common/DataTable';
|
||||
import { useUsers } from 'components/hooks';
|
||||
import UsersTable from './UsersTable';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
export function UsersDataTable({ showActions }: { showActions?: boolean }) {
|
||||
export function UsersDataTable({
|
||||
showActions,
|
||||
children,
|
||||
}: {
|
||||
showActions?: boolean;
|
||||
children?: ReactNode;
|
||||
}) {
|
||||
const queryResult = useUsers();
|
||||
|
||||
if (queryResult?.result?.data?.length === 0) {
|
||||
return children;
|
||||
}
|
||||
|
||||
return (
|
||||
<DataTable queryResult={queryResult}>
|
||||
{({ data }) => <UsersTable data={data} showActions={showActions} />}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue