import e from"@babel/runtime/helpers/slicedToArray";import{jsxs as t,Fragment as r,jsx as o}from"react/jsx-runtime";import{useRef as n,useState as p,useCallback as s}from"react";import{AssetSelectorChip as c}from"../AssetSelectorChip/AssetSelectorChip.js";import{Popover as l}from"../../../../Popover/Popover.js";import{checkIsAssetActive as i}from"../utils.js";import{AssetSelectorContent as a}from"./AssetSelectorContent.js";import m from"./AssetSelectorSelect.scss.js";var u=function(u){var f=u.type,d=u.currentAsset,v=u.parentId,h=u.parentType,y=u.onChange,A=u.testId,C=u.parentActiveWellId,j=n(null),I=p(!1),S=e(I,2),b=S[0],T=S[1],g=s((function(){return T((function(e){return!e}))}),[]),x=s((function(e){g(),y(e)}),[y,g]);return t(r,{children:[o(c,{name:(null==d?void 0:d.name)||"Select ".concat(f.label),type:f.type,ref:j,onClick:g,testId:A,active:i(d)}),o(l,{open:b,className:m.popover,onClose:g,anchorEl:j.current,type:"menu",children:o(a,{type:f,onChange:x,parentId:v,parentType:h,parentActiveWellId:C})})]})};export{u as AssetSelectorSelect};
//# sourceMappingURL=AssetSelectorSelect.js.map
