Updated session and events queries. Added sessions page.

This commit is contained in:
Mike Cao 2024-07-08 01:45:54 -07:00
parent 082a751ffe
commit db36c37d32
39 changed files with 376 additions and 180 deletions

View file

@ -0,0 +1,25 @@
import { useSessions } from 'components/hooks';
import SessionsTable from './SessionsTable';
import DataTable from 'components/common/DataTable';
import { ReactNode } from 'react';
export default function SessionsDataTable({
websiteId,
children,
}: {
websiteId?: string;
teamId?: string;
children?: ReactNode;
}) {
const queryResult = useSessions(websiteId);
if (queryResult?.result?.data?.length === 0) {
return children;
}
return (
<DataTable queryResult={queryResult} allowSearch={false}>
{({ data }) => <SessionsTable data={data} showDomain={!websiteId} />}
</DataTable>
);
}