import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/regenerator";import{useState as o,useEffect as i}from"react";import{shape as n}from"prop-types";import a from"./components/Predictions.js";import s from"./components/Stages/Stages.js";import{fetchStagesData as m,fetchPredictionsData as p}from"./api.js";import c from"../../../LoadingIndicator/LoadingIndicator.js";import{jsx as u,jsxs as l,Fragment as d}from"react/jsx-runtime";var f=function(n){var f,g,b,v,x=n.feedItem,I=o({}),h=t(I,2),y=h[0],j=h[1],w=o({}),_=t(w,2),q=_[0],R=_[1],T=o(!1),D=t(T,2),L=D[0],N=D[1],S=null===(f=x.well)||void 0===f?void 0:f.id,k=null===(g=x.context)||void 0===g||null===(b=g.completion_actual_stage)||void 0===b||null===(v=b.data)||void 0===v?void 0:v.stage_number;return i((function(){function t(){return(t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),e.t0=j,e.next=4,p({wellId:S,stageNumber:k});case 4:return e.t1=e.sent,(0,e.t0)(e.t1),e.t2=R,e.next=9,m({wellId:S,stageNumber:k});case 9:e.t3=e.sent,(0,e.t2)(e.t3),N(!1);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){t.apply(this,arguments)}()}),[]),L?u(c,{fullscreen:!1}):l(d,{children:[u(a,{stages:q,predictionsData:y}),u(s,{feedItem:x,stages:q,predictionsData:y})]})};f.propTypes={feedItem:n({context:n({completion_actual_stage:n({data:n().isRequired}).isRequired}).isRequired}).isRequired};export{f as default};
//# sourceMappingURL=index.js.map
