<script setup>
import { defineAsyncComponent } from "vue";

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

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

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

const seoTitles = {
  zh: "公司概况 | FiEE",
  en: "Company Overview | FiEE",
  ja: "会社概要 | FiEE",
  "zh-TW": "公司概況 | FiEE",
};

const seoDescriptions = {
  zh: "了解FiEE的历史、使命以及我们在电子行业追求卓越的承诺。",
  en: "Learn about FiEE history, mission and our commitment to excellence in the electronics industry.",
  ja: "FiEEの歴史、使命、およびエレクトロニクス業界における卓越性への取り組みをご覧ください。",
  "zh-TW": "了解FiEE的歷史、使命以及我們在電子行業追求卓越的承諾。",
};

const currentLocale = locale.value;

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

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