mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 17:45:38 +01:00
Moved code into src folder. Added build for component library.
This commit is contained in:
parent
7a7233ead4
commit
ede658771e
490 changed files with 749 additions and 442 deletions
24
src/pages/reports/[id].js
Normal file
24
src/pages/reports/[id].js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { useRouter } from 'next/router';
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import ReportDetails from 'components/pages/reports/ReportDetails';
|
||||
import { useApi, useMessages } from 'components/hooks';
|
||||
|
||||
export default function () {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const router = useRouter();
|
||||
const { id } = router.query;
|
||||
const { get, useQuery } = useApi();
|
||||
const { data: report } = useQuery(['reports', id], () => get(`/reports/${id}`), {
|
||||
enabled: !!id,
|
||||
});
|
||||
|
||||
if (!id || !report) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<AppLayout title={formatMessage(labels.websites)}>
|
||||
<ReportDetails reportId={report.id} reportType={report.type} />
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue