---
// import Tag from './Tag.astro';
const { slug, title, tags, description, date } = Astro.props;
---

<li class="post">
	<a href={`/post/${slug}/`} class="title">{title}</a>
	<time datetime={date}>
		{
			new Date(date).toLocaleDateString("en-us", {
				year: "numeric",
				month: "short",
				day: "numeric",
			})
		}
	</time>
	<br />
	{description && <span class="excerpt">{description}</span>}
	<div>
		{
			tags &&
				tags.map((tag) => (
					<a class="tag" href={`/tag/${tag}`}>
						#{tag}
					</a>
				))
		}
	</div>
</li>
