<template>
  <UApp>
    <NuxtLayout>
      <NuxtPage />
    </NuxtLayout>
  </UApp>
  <ConfirmModal />
</template>

<script setup lang="ts">
import { useHead } from "#imports";
import { onMounted } from "vue";
import { composSystemTheme } from "@/composables/composSystemTheme";
//  تنظیم تم سیستم
useHead({
  script: [
    {
      innerHTML: `
      (function() {
        var mode = localStorage.getItem('theme-mode');
        if (mode === 'dark') {
          document.documentElement.classList.add('dark');
        } else {
          document.documentElement.classList.remove('dark');
        }
      })();
    `,
      type: "text/javascript",
      tagPriority: -1,
    },
  ],
});
const { applyTheme } = composSystemTheme();
onMounted(() => {
  applyTheme();
});
</script>

<style></style>
