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

26 lines
976 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>
)
}