import { useEffect } from "react"; import { eventSummary } from "shared/lib/slickgrid"; import { SELECTED_ROWS_SUMMARY } from "../../model"; export function useMakeVisible(isOpened: boolean) { useEffect(() => { if (!isOpened) return; const popup = document.getElementById(SELECTED_ROWS_SUMMARY); if (!popup) return; popup.style.visibility = "visible"; popup.style.left = `${eventSummary.x}px`; popup.style.top = `${eventSummary.y}px`; }, [isOpened]); }