add missing import

This commit is contained in:
Francis Cao 2025-04-22 07:44:43 -07:00
parent 8d3aad8454
commit 7a0765fb4b
3 changed files with 192 additions and 242 deletions

View file

@ -6,8 +6,9 @@ import GoalReport from '../goals/GoalsReport';
import InsightsReport from '../insights/InsightsReport';
import JourneyReport from '../journey/JourneyReport';
import RetentionReport from '../retention/RetentionReport';
import UTMReport from '../utm/UTMReport';
import RevenueReport from '../revenue/RevenueReport';
import UTMReport from '../utm/UTMReport';
import AttributionReport from '../attribution/AttributionReport';
const reports = {
funnel: FunnelReport,
@ -18,6 +19,7 @@ const reports = {
goals: GoalReport,
journey: JourneyReport,
revenue: RevenueReport,
attribution: AttributionReport,
};
export default function ReportPage({ reportId }: { reportId: string }) {

View file

@ -1,38 +0,0 @@
import EmptyPlaceholder from '@/components/common/EmptyPlaceholder';
import { useMessages } from '@/components/hooks';
import { useContext } from 'react';
import { GridColumn, GridTable } from 'react-basics';
import { ReportContext } from '../[reportId]/Report';
import { formatLongCurrency } from '@/lib/format';
export function AttributionTable() {
const { report } = useContext(ReportContext);
const { formatMessage, labels } = useMessages();
const { data } = report || {};
if (!data) {
return <EmptyPlaceholder />;
}
return (
<GridTable data={data.table || []}>
<GridColumn name="currency" label={formatMessage(labels.currency)} alignment="end">
{row => row.currency}
</GridColumn>
<GridColumn name="currency" label={formatMessage(labels.total)} width="300px" alignment="end">
{row => formatLongCurrency(row.sum, row.currency)}
</GridColumn>
<GridColumn name="currency" label={formatMessage(labels.average)} alignment="end">
{row => formatLongCurrency(row.count ? row.sum / row.count : 0, row.currency)}
</GridColumn>
<GridColumn name="currency" label={formatMessage(labels.transactions)} alignment="end">
{row => row.count}
</GridColumn>
<GridColumn name="currency" label={formatMessage(labels.uniqueCustomers)} alignment="end">
{row => row.unique_count}
</GridColumn>
</GridTable>
);
}
export default AttributionTable;