mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
26 lines
621 B
TypeScript
26 lines
621 B
TypeScript
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>
|
|
);
|
|
}
|