File size: 1,514 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { type Callback } from '@automattic/calypso-router';
import PageViewTracker from 'calypso/a8c-for-agencies/components/a4a-page-view-tracker';
import ReportsSidebar from 'calypso/a8c-for-agencies/components/sidebar-menu/reports';
import SidebarPlaceholder from 'calypso/a8c-for-agencies/components/sidebar-placeholder';
import ReportsLanding from './landing';
import BuildReport from './primary/build-report';
import ReportsDashboard from './primary/dashboard';
import ReportsOverview from './primary/overview';

export const reportsLandingContext: Callback = ( context, next ) => {
	context.primary = <ReportsLanding />;
	context.secondary = <SidebarPlaceholder />;
	next();
};

export const reportsOverviewContext: Callback = ( context, next ) => {
	context.secondary = <ReportsSidebar path={ context.path } />;
	context.primary = (
		<>
			<PageViewTracker title="Reports > Overview" path={ context.path } />
			<ReportsOverview />
		</>
	);

	next();
};

export const reportsDashboardContext: Callback = ( context, next ) => {
	context.secondary = <ReportsSidebar path={ context.path } />;
	context.primary = (
		<>
			<PageViewTracker title="Reports > Dashboard" path={ context.path } />
			<ReportsDashboard />
		</>
	);

	next();
};

export const reportsBuildContext: Callback = ( context, next ) => {
	context.secondary = <ReportsSidebar path={ context.path } />;
	context.primary = (
		<>
			<PageViewTracker title="Reports > Build" path={ context.path } />
			<BuildReport />
		</>
	);
	next();
};