umami/src/app/(main)/reports/[reportId]/ReportPage.tsx

28 lines
743 B
TypeScript
Raw Normal View History

2024-02-06 09:38:33 +01:00
'use client';
2024-03-14 10:45:00 +01:00
import FunnelReport from '../funnel/FunnelReport';
import EventDataReport from '../event-data/EventDataReport';
import InsightsReport from '../insights/InsightsReport';
import RetentionReport from '../retention/RetentionReport';
import UTMReport from '../utm/UTMReport';
import { useReport } from 'components/hooks';
2024-03-14 10:45:00 +01:00
const reports = {
funnel: FunnelReport,
'event-data': EventDataReport,
insights: InsightsReport,
retention: RetentionReport,
utm: UTMReport,
};
export default function ReportPage({ reportId }: { reportId: string }) {
const { report } = useReport(reportId);
if (!report) {
return null;
}
const ReportComponent = reports[report.type];
return <ReportComponent reportId={reportId} />;
2023-05-18 08:20:06 +02:00
}