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