on ffc6e46 help sign in
urbit.org/components/GrantProgramOverview.js
54 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 Container from "./Container";
8import Header from "./Header";
9import Footer from "./Footer";
10import SingleColumn from "./SingleColumn";
11import Section from "./Section";
12import { DateTime } from "luxon";
13import Markdown from "./Markdown";
15export default function GrantProgramOverview({
16 post,
17 search,
18 program,
19 actionLink,
20 actionText,
21}) {
22 const router = useRouter();
23 if (!router.isFallback && !post?.slug) {
24 return <ErrorPage />;
25 }
27 const title = program.charAt(0).toUpperCase() + program.slice(1);
28 return (
29 <Container>
30 <Head>
31 <title>{title} • Grants • urbit.org</title>
32 {Meta(post)}
33 </Head>
34 <SingleColumn>
35 <Header search={search} />
36 <Section narrow short>
37 <h1>{post.title}</h1>
38 <div className="type-ui text-wall-500 mt-4 md:mt-8 lg:mt-10">
39 Last Revision: {formatDate(DateTime.fromISO(post.date))}
40 </div>
41 <Link href={actionLink} passHref>
42 <a className="button-sm bg-green-400 text-white mt-8 max-w-fit">
43 {actionText}
44 </a>
45 </Link>
46 </Section>
47 <Section narrow short className="markdown">
48 <Markdown post={post} />
49 </Section>
50 </SingleColumn>
51 <Footer />
52 </Container>
53 );