UNPKG

@anoki/fse-ui

Version:

FSE UI components library

25 lines (24 loc) 589 B
import { useCopyToClipboard as c } from "./index.es503.js"; import { useState as n } from "react"; const l = () => { const [e, t] = c(), [p, o] = n(!1); return { isCopied: p, copiedText: e, copyToClipboard: () => { if (typeof window > "u") return; const r = window.location.href; t(r).then(() => { o(() => !0), setTimeout(() => { o(!1); }, 1500); }).catch((i) => { console.debug("Failed to copy!", i); }); } }; }; export { l as useCopyToClipboardCurrentPage }; //# sourceMappingURL=index.es317.js.map