import { useEffect } from "react";

export default function useOpenLogsTabListener(setActiveTab) {
  useEffect(() => {
    const handleOpenLogs = () => setActiveTab("logs");
    window.addEventListener("openLogsTab", handleOpenLogs);
    return () => window.removeEventListener("openLogsTab", handleOpenLogs);
  }, [setActiveTab]);
}
