Leaflet Blog in Deno Fresh
1import { date } from "../lib/date.ts";
2import { env } from "../lib/env.ts";
3
4import { Paragraph } from "./typography.tsx";
5import type { ComponentChildren } from "preact";
6
7export function PostInfo({
8 createdAt,
9 content,
10 includeAuthor = false,
11 className,
12 children,
13}: {
14 createdAt?: string;
15 content: string;
16 includeAuthor?: boolean;
17 className?: string;
18 children?: ComponentChildren;
19}) {
20 return (
21 <Paragraph className={className}>
22 {includeAuthor && (
23 <>
24 <a
25 href={`https://bsky.app/profile/${env.NEXT_PUBLIC_BSKY_DID}`}
26 className="hover:underline hover:underline-offset-4"
27 >
28 Roscoe Rubin-Rottenberg
29 </a>{" "}
30 ·{" "}
31 </>
32 )}
33 {createdAt && (
34 <>
35 <time dateTime={createdAt}>{date(new Date(createdAt))}</time>{" "}
36 ·{" "}
37 </>
38 )}
39 {children}
40 </Paragraph>
41 );
42}