---
import PostPreview from './PostPreview.astro'
const { posts } = Astro.props
const sortedPosts = posts.sort((a, b) => new Date(b.date) - new Date(a.date));
---
<section class="post-preview__list">
    {sortedPosts.map((post) => (
        <PostPreview post={post}/>
    ))}
</section>
<style>
    .post-preview__list {
        @apply flex flex-col gap-12
    }
</style>
