<template>
  <component :is="components[data.template]" v-if="data" :data="data" />
</template>

<script setup>
import { useApiStore } from "./stores/api";
import { ref } from "vue";
import home from "./views/Home.vue";
import inspirations from "./views/Inspirations.vue";

const components = {
  home, inspirations
};

const data = ref(null);
const api = useApiStore();
api.fetchPageData().then((res) => (data.value = res));
</script>
