<template>
  <main
    class="bg-white overflow-hidden flex flex-col justify-between flex-1 rounded-t-2xl lg:rounded-t-3xl relative"
  >
    <div class="overflow-y-auto no-scroll-bar px-4 lg:mr-3 sm:px-3 lg:px-6 w-full">
      <div v-if="route.path !== '/home'" class="mt-4 lg:mt-6 max-w-7xl">
        <h1 class="text-lg font-semibold md:text-xl text-dark">{{ pageTitle }}</h1>
      </div>
      <div class="flex-1 mt-2 sm:mt-4 dx-viewport">
        <slot></slot>
      </div>
    </div>
  </main>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'

// Dapatkan objek route dari vue-router
const route = useRoute()

// Dapatkan nama rute menggunakan computed property
const pageTitle = computed(() => route.name)
</script>
