<template>
    <Projects :contents="galerie" />
</template>

<script>
import Projects from '@/components/Projects.vue';

export default {
    setup() {
        const galerie = ref([]);

        const { data: itemsData, error: itemsError } = useFetch('/api/items/galerie', { server: true });
        onMounted(async () => {
            if (!itemsError.value && itemsData.value) {
                galerie.value = itemsData.value.data;
            }
        });

        return {
            galerie,
            itemsError
        };
    },
    components: {
        Projects
    }
};
</script>