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

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

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

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

const seoTitles = {
  zh: "投资计算器 | 股东工具 | FiEE",
  en: "Investment Calculator | Shareholder Tools | FiEE",
  ja: "投資計算機 | 株主ツール | FiEE",
  "zh-TW": "投資計算器 | 股東工具 | FiEE",
};

const seoDescriptions = {
  zh: "使用FiEE投资计算器估算您的回报并分析股票表现。",
  en: "Use the FiEE investment calculator to estimate your returns and analyze stock performance.",
  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>




