<template>
    <div class="container mt-4">
        <div v-if="posts.length === 0" class="text-center">
            게시물이 없습니다.
        </div>
        <div v-for="post in posts" :key="post.id">
            <BoardCard
                :img="post.img"
                :category="post.category"
                :title="post.title"
                :content="post.content"
                :date="post.date"
                :likes="post.likes"
                :comments="post.comments"
                />
        </div>
    </div>
</template>

<script>
import BoardCard from './BoardCard.vue';

export default {
    components: {
        BoardCard,
    },
    props: {
        posts: {
            type: Array,
            required: true,
        },
    },
};
</script>

<style>
</style>
