mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 17:15:37 +01:00
checkpoint
This commit is contained in:
parent
cb038a51f3
commit
de509e7ccc
23 changed files with 335 additions and 236 deletions
38
components/pages/reports/funnel/FunnelPage.js
Normal file
38
components/pages/reports/funnel/FunnelPage.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { useMutation } from '@tanstack/react-query';
|
||||
import Page from 'components/layout/Page';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
import ReportsLayout from 'components/layout/ReportsLayout';
|
||||
import useApi from 'hooks/useApi';
|
||||
import { useState } from 'react';
|
||||
import FunnelChart from './FunnelChart';
|
||||
import FunnelTable from './FunnelTable';
|
||||
import FunnelForm from './FunnelForm';
|
||||
|
||||
import styles from './FunnelPage.module.css';
|
||||
|
||||
export default function FunnelPage() {
|
||||
const { post } = useApi();
|
||||
const { mutate, error, isLoading } = useMutation(data => post('/reports/funnel', data));
|
||||
const [data, setData] = useState([{}]);
|
||||
const [formData, setFormData] = useState();
|
||||
|
||||
function handleOnSearch(data) {
|
||||
setFormData(data);
|
||||
|
||||
mutate(data, {
|
||||
onSuccess: async data => {
|
||||
setData(data);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<ReportsLayout filter={<FunnelForm onSearch={handleOnSearch} />} header={'test'}>
|
||||
<Page>
|
||||
<PageHeader title="Funnel Report"></PageHeader>
|
||||
<FunnelChart data={data} />
|
||||
<FunnelTable data={data} />
|
||||
</Page>
|
||||
</ReportsLayout>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue