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