"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("@mui/icons-material/ContentCopy"),o=require("@mui/icons-material/Done"),n=require("../../_virtual/index.js"),i=require("react/jsx-runtime");function c(n){var c=n.textToCopy,u=r.useState(!1),a=e.slicedToArray(u,2),s=a[0],l=a[1];return i.jsx("div",{onClick:function(){if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(c).then(function(){l(!0),setTimeout(function(){return l(!1)},2e3)}).catch(function(e){console.error("Failed to copy text: ",e)});else{var e=document.createElement("textarea");e.value=c,document.body.appendChild(e),e.select();try{document.execCommand("copy")?(l(!0),setTimeout(function(){return l(!1)},2e3)):console.error("Copy command was unsuccessful")}catch(e){console.error("Unable to copy",e)}document.body.removeChild(e)}},style:{cursor:"pointer"},children:s?i.jsx(o,{color:"success"}):i.jsx(t,{})})}c.propTypes={textToCopy:n.default.string},exports.CopyIcon=c,exports.default=c;
//# sourceMappingURL=CopyIcon.js.map
