<script setup>
import { defineAsyncComponent } from 'vue'

const size375 = defineAsyncComponent(() => import("@/views/contacts/size375/index.vue"));
const size768 = defineAsyncComponent(() => import("@/views/contacts/size768/index.vue"));
const size1440 = defineAsyncComponent(() => import("@/views/contacts/size1440/index.vue"));
const size1920 = defineAsyncComponent(() => import("@/views/contacts/size1920/index.vue"));

const { viewComponent, componentKey } = useViewSelector({
  size375,
  size768,
  size1440,
  size1920,
});

const bg = usePageBackground("bg-contacts.png");

definePageMeta({
  layout: "default",
});

// 国际化支持
const { locale } = useI18n();

const seoTitles = {
  zh: "联系我们 | FiEE",
  en: "Contact Us | FiEE",
  ja: "お問い合わせ | FiEE",
  "zh-TW": "聯繫我們 | FiEE",
};

const seoDescriptions = {
  zh: "联系我们的团队获取支持、咨询或合作机会。",
  en: "Get in touch with our team for support, inquiries, or partnership opportunities.",
  ja: "サポート、お問い合わせ、またはパートナーシップの機会については、当社チームにお問い合わせください。",
  "zh-TW": "聯繫我們的團隊獲取支持、諮詢或合作機會。",
};

const currentLocale = locale.value;

useSeoMeta({
  title: seoTitles[currentLocale] || seoTitles.en,
  description: seoDescriptions[currentLocale] || seoDescriptions.en,
  ogTitle: seoTitles[currentLocale] || seoTitles.en,
});

provide('pageBg', bg);
</script>

<template>
  <component :is="viewComponent" :key="componentKey" />
</template>
