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

const size375 = defineAsyncComponent(() => import("@/views/historic-stock/index.vue"));
const size768 = defineAsyncComponent(() => import("@/views/historic-stock/index.vue"));
const size1440 = defineAsyncComponent(() => import("@/views/historic-stock/index.vue"));
const size1920 = defineAsyncComponent(() => import("@/views/historic-stock/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: "Historical Stock Price | Market Data | FiEE",
  ja: "過去の株価 | 市場データ | FiEE",
  "zh-TW": "歷史股價 | 市場數據 | FiEE",
};

const seoDescriptions = {
  zh: "下载并分析FiEE的历史股价数据和市场表现趋势。",
  en: "Download and analyze FiEE's historical stock price data and market performance trends.",
  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>
