Updated data table render check.

This commit is contained in:
Mike Cao 2024-05-07 23:09:19 -07:00
parent 3c27f08a97
commit 90bd72cf98
4 changed files with 27 additions and 2 deletions

View file

@ -1,17 +1,24 @@
import DataTable from 'components/common/DataTable';
import TeamsTable from 'app/(main)/settings/teams/TeamsTable';
import { useLogin, useTeams } from 'components/hooks';
import { ReactNode } from 'react';
export function TeamsDataTable({
allowEdit,
showActions,
children,
}: {
allowEdit?: boolean;
showActions?: boolean;
children?: ReactNode;
}) {
const { user } = useLogin();
const queryResult = useTeams(user.id);
if (queryResult?.result?.data?.length === 0) {
return children;
}
return (
<DataTable queryResult={queryResult}>
{({ data }) => {