---
import { Tag } from 'src/types';

import BlogHeader from '@components/BlogHeader.astro';
import Tags from '@components/Tags.astro';

interface Post {
	data: {
		title: string;
		pubDate: Date;
		tags: Tag[];
	};
	slug: string;
}

interface Props {
	post: Post;
}

const { post } = Astro.props;
const { data, slug } = post;
---

<article class="post-preview">
	<div>
		<BlogHeader title={post.data.title} date={data.pubDate} slug={slug} />
		<Tags tags={data.tags} />
	</div>
</article>
