import React, { useLayoutEffect } from 'react'; import HoverInfo from 'app/shared/components/hoverInfo/hoverInfo'; import { EarningsTable } from 'app/modules/earnings/components/earningsTable'; import * as Text from 'app/shared/components/text/text'; import { useSelector } from 'react-redux'; import { selectCurrentTcePeriod, selectEarningsXlsData, selectEarningsXlsName, selectNumberOfEarningsVessels, selectIsPaginatedFlag, selectIsEarningsPageLoading, } from '../store/earnings.selectors'; import { ButtonDownloadXLS } from 'app/modules/exportToXls/components/buttonDownloadXLS/buttonDownloadXLS'; import { xlsColumnsConfig } from '../configs/earningsTable.config'; import TceKeyValues from '../components/tceKeyValues'; import { TceBenchmarkToggle } from '../components/tceBenchmarkToggle'; import { selectIsBenchmarkModeChangeAvailable } from '../store/benchmark.selectors'; import { Spinner } from 'app/shared/components/spinner/spinner'; import { TceChart } from '../components/chart/tceChart'; import { TceChartPagination } from '../components/chart/tceChartPagination'; import { selectEarningsScrollPosition } from 'app/shared/store/ui/ui.selectors'; import { selectAreVesselsLoading } from '../store/vessels/vessels.selectors'; const EarningsPoolPage = () => { const numberOfVessels = useSelector(selectNumberOfEarningsVessels); const currentTceMonth = useSelector(selectCurrentTcePeriod); const earningsXlsRows = useSelector(selectEarningsXlsData); const xlsFileName = useSelector(selectEarningsXlsName); const isBenchmarkToggleAvailable = useSelector(selectIsBenchmarkModeChangeAvailable); const scroll = useSelector(selectEarningsScrollPosition); const isLoading = useSelector(selectIsEarningsPageLoading); const areVesselsLoading = useSelector(selectAreVesselsLoading); const isPaginated = useSelector(selectIsPaginatedFlag); useLayoutEffect(() => { if (!isLoading && !areVesselsLoading) { setTimeout(() => { window.scrollTo(0, scroll || 0); }, 0); } }, [ isLoading, areVesselsLoading ]); return <> { isLoading ? :
Pool pay out All figures adjusted for known financial elements in accordance with IFRS
{ isBenchmarkToggleAvailable &&
}
Earnings are NET and for a vessel with average points and consumption
{isPaginated && }
Vessels {numberOfVessels}
{currentTceMonth}
{areVesselsLoading ? : }
} ; }; export { EarningsPoolPage };