import React, { useEffect } from "react";

import { useDispatch, useSelector } from "react-redux";

const SystemNotification = () => {
  const dispatch = useDispatch();
  const { systemNotice, systemTermination } = useSelector(
    (state) => state.common
  );

  useEffect(() => {
    if (systemNotice) {
      console.log("------------------- system notice -------------------");
    }
  }, [systemNotice]);

  useEffect(() => {
    if (systemTermination) {
      if (systemTermination.isInitialLoad) {
        console.log(
          "------------------- Application will be shut down for server inspection (initial launch) -------------------"
        );
      } else {
        console.log(
          "------------------- Application will be shut down for server inspection (using the app) -------------------"
        );
      }
    }
  }, [systemTermination]);

  return null;
};

export default SystemNotification;
