<script setup>
import AlertSubList from "./AlertSubList.vue";
import AlertOutliersTable from "./AlertOutliersTable.vue";
import AlertNotifyTable from "./AlertNotifyTable.vue";
import { ref, provide, onMounted, watch } from "vue";
import { getNoticeList } from "@/apis/alert";
import { useI18n } from "vue-i18n";
const { locale } = useI18n();

const noticeList = ref([]);

const NoticeListData = async () => {
  const res = await getNoticeList(locale.value);
  noticeList.value = res.data;
};

watch(locale, () => {
  NoticeListData();
});

onMounted(() => {
  NoticeListData();
});

provide("notify_table", { noticeList });
</script>

<template>
  <div>
    <AlertSubList />
    <AlertOutliersTable />
    <AlertNotifyTable />
  </div>
</template>

<style lang="scss" scoped></style>
