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

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

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

const bg = usePageBackground("bg-contacts.png");

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

const route = useRoute();
watch(
  bg,
  (newBg) => {
    if (route.meta) {
      route.meta.bg = newBg;
    }
  },
  { immediate: true }
);

useSeoMeta({
  title: "Email Alerts | Stay Informed | FiEE",
  description:
    "Subscribe to FiEE email alerts to receive the latest press releases and financial updates directly.",
  ogTitle: "Subscribe to FiEE Updates",
});
</script>

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