import React, { useRef } from 'react'; import { useSelector } from 'react-redux'; import { Route, Switch } from 'react-router-dom'; import { routes } from 'app/common/routes'; import { POOL_SECTION } from 'app/modules/pools/store'; import { TopNavigation } from 'app/modules/navigation/components/topNavigation'; import useGAClickTracking from '../../../shared/hooks/useGAClickTracking.hook'; import { selectEmbeddedBiReportData } from '../store/bi.selectors'; import useReports from '../../../shared/hooks/report.hooks'; import useIframeHotjarTracking from '../../../shared/hooks/useIframeHotjarTracking.hook'; import { SubHeader } from '../../../shared/components/topBar/subHeader'; import { BiYearFilterContainer } from '../conteiners/biYearFilter.container'; import CircleIcon from '../../../shared/components/circleIcon/circleIcon'; import { Report } from 'powerbi-report-component'; const reportStyle = { height: 754, paddingBottom: '2em', }; const extraSettings = { filterPaneEnabled: false, navContentPaneEnabled: false, }; const printButtonClickGAInfo = { eventCategory: 'OnPage function', eventAction: 'print', eventLabel: 'Reports', }; const expandButtonClickGAInfo = { eventCategory: 'OnPage function', eventAction: 'full screen', eventLabel: 'Reports', }; const ReportsPage = () => { const { token, reportId, reportUrl, filters } = useSelector(selectEmbeddedBiReportData); const { handleReportLoad, handleReportRender, handlePageChange, setFullscreen, printReport, } = useReports(filters); const reportRef = useRef(null); const buttonsContainerRef = useRef(null); useIframeHotjarTracking(reportRef?.current?.children[0]?.children[0] as HTMLIFrameElement); useGAClickTracking(buttonsContainerRef.current?.children[0], printButtonClickGAInfo); useGAClickTracking(buttonsContainerRef.current?.children[1], expandButtonClickGAInfo); return <>
{reportUrl && reportId && token &&
}
{reportUrl && reportId && token &&
}
; }; export default ReportsPage;