mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 02:25:35 +01:00
Metrics components refactoring. New event data page.
This commit is contained in:
parent
4e6d24e932
commit
c865f43b11
47 changed files with 756 additions and 672 deletions
30
components/pages/websites/WebsiteReportsPage.js
Normal file
30
components/pages/websites/WebsiteReportsPage.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import Page from 'components/layout/Page';
|
||||
import Link from 'next/link';
|
||||
import { Button, Icon, Icons, Text, Flexbox } from 'react-basics';
|
||||
import { useMessages, useReports } from 'hooks';
|
||||
import ReportsTable from 'components/pages/reports/ReportsTable';
|
||||
import WebsiteHeader from './WebsiteHeader';
|
||||
|
||||
export function WebsiteReportsPage({ websiteId }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { reports, error, isLoading } = useReports(websiteId);
|
||||
|
||||
return (
|
||||
<Page loading={isLoading} error={error}>
|
||||
<WebsiteHeader websiteId={websiteId} />
|
||||
<Flexbox alignItems="center" justifyContent="end">
|
||||
<Link href="/reports/create">
|
||||
<Button variant="primary">
|
||||
<Icon>
|
||||
<Icons.Plus />
|
||||
</Icon>
|
||||
<Text>{formatMessage(labels.createReport)}</Text>
|
||||
</Button>
|
||||
</Link>
|
||||
</Flexbox>
|
||||
<ReportsTable websiteId={websiteId} data={reports} />
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
export default WebsiteReportsPage;
|
||||
Loading…
Add table
Add a link
Reference in a new issue