import e from"moment";import t from"@material-ui/icons/Delete";import o from"@material-ui/icons/CenterFocusStrong";import a from"./popup.css.js";import{jsxs as l,jsx as i}from"react/jsx-runtime";var n="popupGenerator",c=function(c,r,s,p){return function(u){var d=u.well,m=u.color,f=r.includes(d.id),N=c&&c.id===d.id;return l("div",{className:a.popup,children:[l("div",{children:[i("div",{className:a.wellColor,style:{backgroundColor:m}}),i("span",{className:a.wellName,children:d.name})]}),l("div",{className:a.popupInfo,children:["Well Depth:",Number.isFinite(d.rigReleaseDate)?"".concat(Math.floor(d.totalDepth)," ft"):"N/A"]}),l("div",{className:a.popupInfo,children:["Release Date:",Number.isFinite(d.rigReleaseDate)?e.unix(d.rigReleaseDate).format("MM/DD/YYYY"):"N/A"]}),l("div",{className:a.popupActions,children:[l("div",N?{"data-testid":"".concat(n,"_removeSubjectWell"),className:a.popupButton,onClick:function(){return s(d.id,N)},children:[i("div",{className:a.popupButtonIcon,children:i(t,{})}),i("div",{className:a.popupButtonLabel,children:"Remove Subject Well"})]}:{"data-testid":"".concat(n,"_setSubjectWell"),className:a.popupButton,onClick:function(){return s(d.id,N)},children:[i("div",{className:a.popupButtonIcon,children:i(o,{})}),i("div",{className:a.popupButtonLabel,children:"Set Subject Well"})]}),!N&&i("div",{className:"".concat(a.popupButton," ").concat(a.popupButtonContained),onClick:function(){return p(d.id,f)},children:i("div",f?{"data-testid":"".concat(n,"_removeOffsetWell"),className:a.popupButtonLabel,children:"Remove Offset"}:{"data-testid":"".concat(n,"_selectOffsetWell"),className:a.popupButtonLabel,children:"Select As Offset"})})]})]})}};export{c as default};
