I'm surprised this doesn't work since you could easily externalize this to a function:
<Layout>
<Header />
{getCorrectComponent(page)}
<Footer />
</Layout>
const getCorrectComponent = (page) => {
switch (page) {
case 'home': return <Home />
case 'about': return <About />
default: return <NotFound />
}
}