<script lang="ts" setup>
import MenuBar from "./components/MenuBar.vue";
import {RouteRecordName, RouterView} from "vue-router";
import CalendarPreview from "./components/CalendarPreview.vue";
import moduleStore from "./store/moduleStore.ts";

const disabledPages = ["room-finder", "faq", "imprint", "privacy-policy", "edit"];

const store = moduleStore();

const isDisabled = (routeName: RouteRecordName | null | undefined) => {
  return !disabledPages.includes(routeName as string) && store.modules.size > 0
};

</script>

<template>
  <MenuBar />
  <RouterView />
  <!-- show CalendarPreview but only on specific router views -->
  <CalendarPreview v-if="isDisabled($route.name)"/>
</template>

<style scoped></style>
