<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 route = useRoute();
watch(
  bg,
  (newBg) => {
    if (route.meta) {
      route.meta.bg = newBg;
    }
  },
  { immediate: true }
);

useSeoMeta({
  title: "Historical Stock Price | Market Data | FiEE",
  description:
    "Download and analyze FiEE's historical stock price data and market performance trends.",
  ogTitle: "FiEE Historical Stock Data",
});
</script>

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