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