on ff6ec50 help sign in
urbit.org/components/GrantProgramOverview.js
59 lines 1.6 kB history raw
1import { useRouter } from "next/router";
2import Link from "next/link";
3import Head from "next/head";
4import Meta from "../components/Meta";
5import ErrorPage from "../pages/404";
6import {
7 Container,
8 Section,
9 SingleColumn,
10 Markdown,
11 IntraNav,
12 formatDate,
13} from "@urbit/foundation-design-system";
14import Header from "./Header";
15import Footer from "./Footer";
16import { DateTime } from "luxon";
18export default function GrantProgramOverview({
19 post,
20 markdown,
21 search,
22 program,
23 actionLink,
24 actionText,
25}) {
26 const router = useRouter();
27 if (!router.isFallback && !post?.slug) {
28 return <ErrorPage />;
29 }
31 const title = program.charAt(0).toUpperCase() + program.slice(1);
32 return (
33 <Container>
34 <Head>
35 <title>{title} • Grants</title>
36 {Meta(post)}
37 </Head>
38 <IntraNav ourSite="https://urbit.org" search={search} />
39 <SingleColumn>
40 <Header search={search} />
41 <Section narrow short>
42 <h1>{post.title}</h1>
43 <div className="type-ui text-wall-500 mt-4 md:mt-8 lg:mt-10">
44 Last Revision: {formatDate(DateTime.fromISO(post.date))}
45 </div>
46 <Link href={actionLink} passHref>
47 <a className="button-sm bg-green-400 text-white mt-8 max-w-fit">
48 {actionText}
49 </a>
50 </Link>
51 </Section>
52 <Section narrow short className="markdown">
53 <Markdown.render content={JSON.parse(markdown)} />
54 </Section>
55 </SingleColumn>
56 <Footer />
57 </Container>
58 );