UNPKG

@anoki/fse-ui

Version:

FSE UI components library

3 lines (2 loc) 495 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index.cjs503.js"),s=require("react"),p=()=>{const[o,t]=c.useCopyToClipboard(),[r,e]=s.useState(!1);return{isCopied:r,copiedText:o,copyToClipboard:()=>{if(typeof window>"u")return;const i=window.location.href;t(i).then(()=>{e(()=>!0),setTimeout(()=>{e(!1)},1500)}).catch(n=>{console.debug("Failed to copy!",n)})}}};exports.useCopyToClipboardCurrentPage=p; //# sourceMappingURL=index.cjs317.js.map