mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 02:25:35 +01:00
Refactored forms and pages.
This commit is contained in:
parent
1325abe31d
commit
6253d55790
57 changed files with 209 additions and 208 deletions
22
src/app/(main)/reports/ReportsDataTable.js
Normal file
22
src/app/(main)/reports/ReportsDataTable.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
'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';
|
||||
|
||||
function useReports() {
|
||||
const { get } = useApi();
|
||||
const modified = useCache(state => state?.reports);
|
||||
return useFilterQuery(['reports', modified], params => get(`/reports`, params));
|
||||
}
|
||||
|
||||
export default function ReportsDataTable() {
|
||||
const queryResult = useReports();
|
||||
|
||||
return (
|
||||
<DataTable queryResult={queryResult}>
|
||||
{({ data }) => <ReportsTable data={data} showDomain={true} />}
|
||||
</DataTable>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue