<script setup lang="ts">
import { ref } from "vue";
import contentConfig from "./config/content.config";
import searchConfig from "./config/search.config";
import CapitalModal from "./components/capital-modal.vue";
import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";

const PageName = "capitalPool";
const capitalModalRef = ref<InstanceType<typeof CapitalModal> | null>(null);

const hooks: PageHooks = {
  pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
};

const events: PageEvents = {
  content: {
    preview: ({ logNo }) => capitalModalRef.value.onDisplay(logNo)
  }
};
</script>

<template>
  <PageAuth :pageName="PageName">
    <PageContainer
      :hooks="hooks"
      :events="events"
      :contentConfig="contentConfig"
      :search-config="searchConfig"
    />
    <CapitalModal ref="capitalModalRef" />
  </PageAuth>
</template>
