on d413305 help sign in
urbit.org/components/BasicPage.js
35 lines 962 B history raw
1import { useRouter } from "next/router";
2import Head from "next/head";
3import Meta from "../components/Meta";
4import ErrorPage from "../pages/404";
5import Container from "./Container";
6import Header from "./Header";
7import Footer from "./Footer";
8import SingleColumn from "./SingleColumn";
9import Section from "./Section";
10import Markdown from "./Markdown";
12export default function BasicPage({ post, markdown, search }) {
13 const router = useRouter();
14 if (!router.isFallback && !post?.slug) {
15 return <ErrorPage />;
16 }
17 return (
18 <Container>
19 <Head>
20 <title>Urbit • {post.title}</title>
21 {Meta(post)}
22 </Head>
23 <SingleColumn>
24 <Header search={search} />
25 <Section narrow>
26 <h1>{post.title}</h1>
27 </Section>
28 <Section narrow className="markdown">
29 <Markdown content={JSON.parse(markdown)} />
30 </Section>
31 </SingleColumn>
32 <Footer />
33 </Container>
34 );