<script setup lang="ts">
import { storeToRefs } from "pinia";
import {
  AApp,
  AMain,
  // AAppBar,
  ASnackbars,
  RouterViewTransition,
  useIntercom,
  useNotifications,
  useRequestInterceptor,
  useInternalTranslations,
} from "@actindo/core-ui";
// import { ROUTE_VIEWS } from "@/router/topBarRoutes";

// const isLocal = import.meta.env.CORE1_ENV === "local";

const { notifications } = storeToRefs(useNotifications());

useIntercom().init();
// useIntercom().init(mainAppRoutes); // send sub navigation routes (main left sidebar) to core app

useInternalTranslations();

useRequestInterceptor();
</script>

<template>
  <AApp class="app-background">
    <!-- todo: in case we have left side navigation routes, we can use this approach to run plugin locally, without core app -->
    <!--    <AAppBar v-if="isLocal" class="flex-grow-0" app height="36">-->
    <!--      <ABtn-->
    <!--        :to="{ name: ROUTE_VIEWS.REMOTE_SAMPLE_PAGE_VIEW }"-->
    <!--        :text="$t('SampleView.remotePageLabel')"-->
    <!--      />-->
    <!--    </AAppBar>-->
    <AMain class="flex-grow-1 overflow-hidden">
      <RouterViewTransition keep-alive />
    </AMain>
    <ASnackbars v-model="notifications" :timeout="8000" />
  </AApp>
</template>
