forked from ddrilling/asb_cloud_front
26 lines
976 B
JavaScript
26 lines
976 B
JavaScript
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>
|
||
)
|
||
}
|