Moved code into src folder. Added build for component library.
This commit is contained in:
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>
|
||||
);
|
||||
}
|
||||
13
src/pages/reports/create.js
Normal file
13
src/pages/reports/create.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import ReportTemplates from 'components/pages/reports/ReportTemplates';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
||||
export default function () {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<AppLayout title={formatMessage(labels.reports)}>
|
||||
<ReportTemplates />
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
13
src/pages/reports/funnel.js
Normal file
13
src/pages/reports/funnel.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import FunnelReport from 'components/pages/reports/funnel/FunnelReport';
|
||||
import useMessages from 'components/hooks/useMessages';
|
||||
|
||||
export default function () {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<AppLayout title={`${formatMessage(labels.funnel)} - ${formatMessage(labels.reports)}`}>
|
||||
<FunnelReport />
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
13
src/pages/reports/index.js
Normal file
13
src/pages/reports/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import ReportsPage from 'components/pages/reports/ReportsPage';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
||||
export default function () {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<AppLayout title={formatMessage(labels.reports)}>
|
||||
<ReportsPage />
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
13
src/pages/reports/insights.js
Normal file
13
src/pages/reports/insights.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import InsightsReport from 'components/pages/reports/insights/InsightsReport';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
||||
export default function () {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<AppLayout title={`${formatMessage(labels.insights)} - ${formatMessage(labels.reports)}`}>
|
||||
<InsightsReport />
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
13
src/pages/reports/retention.js
Normal file
13
src/pages/reports/retention.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import RetentionReport from 'components/pages/reports/retention/RetentionReport';
|
||||
import useMessages from 'components/hooks/useMessages';
|
||||
|
||||
export default function () {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<AppLayout title={`${formatMessage(labels.retention)} - ${formatMessage(labels.reports)}`}>
|
||||
<RetentionReport />
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user