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