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

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

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

const bg = usePageBackground("bg-events-calendar.png");

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

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

const seoTitles = {
  zh: "新闻稿 | 公司公告 | FiEE",
  en: "Press Releases | Corporate Announcements | FiEE",
  ja: "プレスリリース | 企業発表 | FiEE",
  "zh-TW": "新聞稿 | 公司公告 | FiEE",
};

const seoDescriptions = {
  zh: "FiEE的官方企业新闻、媒体公告和新闻稿。",
  en: "Official corporate news, media announcements, and press releases from FiEE.",
  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,
});

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

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