asb_cloud_front/src/pages/WellOperations/WellCompositeEditor/WellCompositeInfo.jsx

26 lines
976 B
React
Raw Normal View History

import { useEffect, useState } from "react"
import { invokeWebApiWrapperAsync } from "../../../components/factory"
import LoaderPortal from "../../../components/LoaderPortal";
import { WellOperationStatService } from "../../../services/api";
import ClusterWells from "../../Cluster/ClusterWells";
export const WellCompositeInfo = ({idWell, selectedIdWells}) => {
const [showLoader, setShowLoader] = useState(false);
const [statsWells, setStatsWells] = useState([]);
useEffect(() => invokeWebApiWrapperAsync(
async () => {
const operations = await WellOperationStatService.getWellsStat(selectedIdWells)
setStatsWells(operations)
},
setShowLoader,
'Не удалось загрузить список операции по скважинам'
), [selectedIdWells])
return (
<LoaderPortal show={showLoader}>
<ClusterWells statsWells={statsWells}/>
</LoaderPortal>
)
}