---
import FormattedDate from './FormattedDate.astro';

interface Props {
	title: string;
	description: string;
	pubDate: Date;
	href: string;
	readTime?: string;
}

const { title, description, pubDate, href, readTime } = Astro.props;
---

<article>
	<a href={href}>
		<h3>{title}</h3>
	</a>
	<p>
		<FormattedDate date={pubDate} />
		{readTime && <span> • {readTime}</span>}
	</p>
	<p>{description}</p>
	<a href={href}>Read more</a>
</article>
