import o from"@babel/runtime/helpers/slicedToArray";import{useState as s,useEffect as t}from"react";import i from"classnames";import c from"prop-types";import{makeStyles as n,Tooltip as r}from"@material-ui/core";import{CopyIcon as e}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import p from"../../utils/main.js";import{jsx as m}from"react/jsx-runtime";var a=n((function(o){return{iconWrapper:{color:o.palette.primary.text6,cursor:"pointer",paddingLeft:4,display:"flex",alignItems:"center","&:hover":{color:o.palette.primary.contrastText}},tooltip:{color:o.palette.primary.text6,backgroundColor:"rgba(20, 20, 20, 0.5)"}}})),l=function(c){var n=c.children,e=c.classes,l=c.dataTestId,u=c.IconComponent,d=c.tooltipProps,I=s(!1),j=o(I,2),f=j[0],h=j[1],C=a();return t((function(){var o=setTimeout((function(){h(!1)}),d.delay);return function(){return clearTimeout(o)}}),[f]),m(r,{classes:{tooltip:i(C.tooltip,e.tooltip),popper:i(C.tooltipPopper,e.tooltipPopper)},title:d.title,open:f,disableFocusListener:!0,disableHoverListener:!0,placement:d.placement,children:m("span",{className:i(C.iconWrapper,e.iconWrapper),onClick:function(){h(!0),p.copyToClipboard(n)},children:m(u,{className:e.icon,"data-testid":l})})})};l.propTypes={children:c.string.isRequired,dataTestId:c.string,IconComponent:c.shape({}),tooltipProps:c.shape({title:c.string,placement:c.string,delay:c.number}),classes:c.shape({root:c.string,icon:c.string,iconWrapper:c.string,tooltip:c.string,tooltipPopper:c.string})},l.defaultProps={dataTestId:null,IconComponent:function(){return m(e,{size:16})},tooltipProps:{title:"Copied",placement:"bottom",delay:1500},classes:{}};export{l as default};
