diff --git a/src/pages/WellOperations/Tvd/AdditionalTables.jsx b/src/pages/WellOperations/Tvd/AdditionalTables.jsx index 1889b63..d9fd228 100755 --- a/src/pages/WellOperations/Tvd/AdditionalTables.jsx +++ b/src/pages/WellOperations/Tvd/AdditionalTables.jsx @@ -1,5 +1,5 @@ import { Descriptions } from 'antd' -import { memo, useEffect, useState } from 'react' +import { memo, useEffect, useMemo, useState } from 'react' import { makeNumericRender } from '@components/Table' import { invokeWebApiWrapperAsync } from '@components/factory' @@ -21,6 +21,8 @@ const printDate = (date) => formatDate(date) ?? '-' export const AdditionalTables = memo(({ operations, xLabel, setIsLoading }) => { const [additionalData, setAdditionalData] = useState({}) + const nptSum = useMemo(() => operations.fact?.reduce((out, row) => out + (row?.durationHours ?? 0), 0), [operations.fact]) + useEffect(() => invokeWebApiWrapperAsync( async () => { const [factStartDate, factEndDate] = calcEndDate(operations.fact) @@ -49,6 +51,7 @@ export const AdditionalTables = memo(({ operations, xLabel, setIsLoading }) => { {printDate(additionalData.endDate)} {numericRender(additionalData.lag)} + {numericRender(nptSum)}