Redo events tab to show all events.

This commit is contained in:
Mike Cao 2024-08-01 21:05:43 -07:00
parent 10f65cae68
commit 9c32057841
18 changed files with 152 additions and 66 deletions

View file

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