Updated data table render check.
This commit is contained in:
@@ -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} />}
|
||||
|
||||
Reference in New Issue
Block a user