<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import AdminLayout from '@/layouts/AdminLayout.vue'
import PublicLayout from '@/layouts/PublicLayout.vue'
import { Toaster } from 'vue-sonner'

const route = useRoute()

const layout = computed(() => {
  if (route.meta.layout === 'admin') {
    return AdminLayout
  }
  return PublicLayout
})
</script>

<template>
  <component :is="layout">
    <router-view />
  </component>
  <Toaster position="top-center" rich-colors />
</template>
