import { AdminShell } from './AdminShell';
import App from './App';
import DashboardApp from './DashboardApp';
import InsightsApp from './InsightsApp';
import AuthorPerfApp from './AuthorPerfApp';
import ProApp from './ProApp';

export default function AdminApp() {
	const boot = window.newsroomSettingsBoot || {};
	const surface = boot.surface || 'dashboard';

	let page = <DashboardApp />;
	if ( surface === 'settings' ) {
		page = <App />;
	} else if ( surface === 'insights' ) {
		page = <InsightsApp />;
	} else if ( surface === 'author-performance' ) {
		page = <AuthorPerfApp />;
	} else if ( surface === 'pro' ) {
		page = <ProApp />;
	}

	return (
		<AdminShell surface={ surface }>
			{ page }
		</AdminShell>
	);
}
