on bc56337 help sign in
urbit.org/components/PostPreview.js
25 lines 721 B history raw
1import Link from "next/link";
2import { Card } from "@urbit/foundation-design-system";
3import { formatDate, generateDisplayDate } from "../lib/lib";
5export default function PostPreview(props) {
6 const section = props?.section ? props.section : "blog";
8 const date = generateDisplayDate(props.post.date);
9 return (
10 <Card
11 slug={`/${section}/${props.post.slug}`}
12 image={props.post.extra.image}
13 title={props?.title || props.post?.title || ""}
14 author={props.post?.extra?.author || ""}
15 ship={props.post?.extra?.ship || ""}
16 content={
17 <div className="text-wall-500 type-sub mt-1">{formatDate(date)}</div>
18 }
19 />
20 );
23PostPreview.defaultProps = {
24 className: "",
25};