on e4dea95 help sign in
urbit.org/components/BasicPage.js
36 lines 1.0 kB history raw
1import { useRouter } from "next/router";
2import Head from "next/head";
3import ErrorPage from "../pages/404";
4import Container from "./Container";
5import Header from "./Header";
6import Footer from "./Footer";
7import SingleColumn from "./SingleColumn";
8import Section from "./Section";
9import markdownStyles from "../styles/markdown.module.css";
10import { decode } from "html-entities";
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 </Head>
22 <SingleColumn>
23 <Header search={search} />
24 <Section narrow>
25 <h1>{post.title}</h1>
26 </Section>
27 <Section narrow className={markdownStyles["markdown"]}>
28 <article
29 dangerouslySetInnerHTML={{ __html: decode(markdown) }}
30 ></article>
31 </Section>
32 </SingleColumn>
33 <Footer />
34 </Container>
35 );