Allow embedding of share page.
This commit is contained in:
1 parent
9cb6046844
commit
eda2c07ea3
10 files changed
+58
-39
No files matched your search
@@ -0,0 +1,20 @@
|
||||
'use client';
|
||||
import { useApi } from 'components/hooks';
|
||||
import ReportsTable from './ReportsTable';
|
||||
import useFilterQuery from 'components/hooks/useFilterQuery';
|
||||
import DataTable from 'components/common/DataTable';
|
||||
import useCache from 'store/cache';
|
||||
|
||||
export default function ReportsDataTable({ websiteId }: { websiteId?: string }) {
|
||||
const { get } = useApi();
|
||||
const modified = useCache(state => (state as any)?.reports);
|
||||
const queryResult = useFilterQuery(['reports', { websiteId, modified }], params =>
|
||||
get(websiteId ? `/websites/${websiteId}/reports` : `/reports`, params),
|
||||
);
|
||||
|
||||
return (
|
||||
<DataTable queryResult={queryResult}>
|
||||
{({ data }) => <ReportsTable data={data} showDomain={!websiteId} />}
|
||||
</DataTable>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user