website/_components/PostListItem.tsx
2024-03-05 18:38:42 -05:00

24 lines
651 B
TypeScript

interface Props {
post: any;
}
export default function (props: Props) {
return (
<li className="post-list-item">
<a href={props.post.data.url} className="post-list-title">
{props.post.data.title}
</a>
<time className="post-list-date">
{Intl.DateTimeFormat("en-CA", { dateStyle: "long" }).format(
props.post.data.date,
)}
</time>
<ul className="tag-list">
{props.post.data.tags.map((tag, index) => (
<li key={index} className="tag">{tag}</li>
))}
</ul>
<p className="post-list-description">{props.post.data.description}</p>
</li>
);
}