import React, { useEffect } from "react";
import { useOrganizationModal } from "./hooks/useOrganization";
import OrganizationModal from "./components/Organization/OrganizationModal";
import { useAuthModal, useModal } from "./hooks/useAuth";
import SwitchTenant from "./pages/authentication/SwitchTenant";
import { ProjectModal } from "./components/Project/ManageProjectInfo";

const ModalProvider = () => {
  const { isOpen, onClose } = useOrganizationModal();
  const { isOpen: isAuthOpen } = useAuthModal();
  const {isOpen:isOpenProject}  = useModal("ManageProject")

  return (
    <>
      {isOpen && <OrganizationModal />}
      {isAuthOpen && <SwitchTenant />}
      {isOpenProject && <ProjectModal/>}
    </>
  );
};

export default ModalProvider;