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 <img 25 width={14} 26 height={14} 27 loading="lazy" 28 src="../assets/me_blue_square.jpg" 29 alt="Roscooe's profile picture" 30 className="inline rounded-full mr-1.5 mb-0.5" 31 /> 32 <a 33 href={`https://bsky.app/profile/${env.NEXT_PUBLIC_BSKY_DID}`} 34 className="hover:underline hover:underline-offset-4" 35 > 36 Roscoe Rubin-Rottenberg 37 </a>{" "} 38 &middot;{" "} 39 </> 40 )} 41 {createdAt && ( 42 <> 43 <time dateTime={createdAt}>{date(new Date(createdAt))}</time>{" "} 44 &middot;{" "} 45 </> 46 )} 47 {children} 48 </Paragraph> 49 ); 50}