import{useEditorMode as e}from"@gem-sdk/core";import{useState as o,useEffect as t}from"react";let useCoupon=r=>{let a=e(),{defaultLabel:c,copyContent:i,clickedLabel:u}=r??{},[l,n]=o(!1),[p,m]=o(c);t(()=>{m(c)},[c]);let s=()=>{m(u),n(!0),navigator.clipboard.writeText(i??"").catch(function(e){console.error("Failed to copy text: ",e)}),setTimeout(()=>{m(c),n(!1)},1e3)};return{changeStateILP:s,defaultLabelState:p,mode:a,dataActive:l}};export{useCoupon as default};
