import t from"@babel/runtime/helpers/slicedToArray";import{memo as e,useState as r}from"react";import o from"prop-types";import{makeStyles as n,TextField as a,InputAdornment as i,Popover as c}from"@material-ui/core";import{Search as l}from"@material-ui/icons";import s from"./AutoCompleteAssetSearch/AutoCompleteAssetSearch.js";import{jsxs as p,Fragment as m,jsx as u}from"react/jsx-runtime";var f=n((function(t){return{searchInput:{fontSize:"16px",width:"270px","&:hover":{"&::before":{borderBottom:"2px solid ".concat(t.palette.primary.text1," !important")}},"&:hover $searchIcon":{fill:"".concat(t.palette.primary.text1," !important")}},searchIcon:{fill:"".concat(t.palette.primary.text6," !important"),fontSize:"24px !important"}}}));function h(e){var o=e.company,n=e.onClickAsset,h=f(),d=r(null),A=t(d,2),x=A[0],y=A[1],v=function(){y(null)};return p(m,{children:[u(a,{"data-testid":"".concat("AssetSearch","_search"),id:"well-section-search-textfield",placeholder:"Add to List by Well/Rig Search",InputProps:{startAdornment:u(i,{position:"start",children:u(l,{className:h.searchIcon})}),className:h.searchInput},onClick:function(t){y(t.currentTarget)}}),u(c,{open:Boolean(x),anchorEl:x,onClose:v,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:u(s,{company:o,onClickAsset:function(t){var e=t.name,r=t.redirectAssetId;r&&(n(r,e),v())},onClose:v})})]})}h.propTypes={company:o.number.isRequired,onClickAsset:o.func.isRequired};var d=e(h);export{d as default};
