<template>
  <div v-if="isAdminPage" v-cloak class="admin-wrap">
    <AdminHeader />
    <AdminMenu />
    <div class="main-warp">
      <div class="router-wrap">
        <router-view />
      </div>
    </div>
  </div>
  <div v-else v-cloak class="user-wrap relative">
    <UserHeader />
    <div class="main-warp">
      <router-view />
    </div>
  </div>
</template>

<script>
import UserHeader from "../layout/UserHeader.vue";
import AdminHeader from "../layout/AdminHeader.vue";
import AdminMenu from "../layout/AdminMenu.vue";

const App = {
  data: () => {
    return {
      otherWindow: false,
    };
  },
  created() {},
  methods: {},
  watch: {},
  computed: {
    isAdminPage() {
      // 현재 URL을 기반으로 사용자와 관리자 페이지 여부를 판단
      return this.$route && this.$route.path.startsWith("/adm");
    },
  },
  components: {
    UserHeader: UserHeader,
    AdminHeader: AdminHeader,
    AdminMenu: AdminMenu,
  },
  mounted() {},
};

export default App;
</script>

<style scoped>
[v-cloak] {
  display: none;
}
</style>
