2020-08-01 04:05:14 +02:00
|
|
|
import { useRouter } from 'next/router';
|
2023-01-11 23:47:38 +01:00
|
|
|
import AppLayout from 'components/layout/AppLayout';
|
2023-07-02 07:02:49 +02:00
|
|
|
import ReportDetails from 'components/pages/reports/ReportDetails';
|
|
|
|
import { useApi, useMessages } from 'hooks';
|
2020-08-01 04:05:14 +02:00
|
|
|
|
2023-07-10 09:33:30 +02:00
|
|
|
export default function () {
|
2023-04-21 04:58:16 +02:00
|
|
|
const { formatMessage, labels } = useMessages();
|
2020-08-01 04:05:14 +02:00
|
|
|
const router = useRouter();
|
|
|
|
const { id } = router.query;
|
2023-07-02 07:02:49 +02:00
|
|
|
const { get, useQuery } = useApi();
|
|
|
|
const { data: report } = useQuery(['reports', id], () => get(`/reports/${id}`), {
|
|
|
|
enabled: !!id,
|
|
|
|
});
|
2020-08-01 04:05:14 +02:00
|
|
|
|
2023-07-02 07:02:49 +02:00
|
|
|
if (!id || !report) {
|
2020-08-04 03:12:28 +02:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2020-08-01 04:05:14 +02:00
|
|
|
return (
|
2023-04-21 04:58:16 +02:00
|
|
|
<AppLayout title={formatMessage(labels.websites)}>
|
2023-07-02 07:02:49 +02:00
|
|
|
<ReportDetails reportId={report.id} reportType={report.type} />
|
2023-01-11 23:47:38 +01:00
|
|
|
</AppLayout>
|
2020-08-01 04:05:14 +02:00
|
|
|
);
|
|
|
|
}
|