UNPKG

@anoki/fse-ui

Version:

FSE UI components library

19 lines (18 loc) 519 B
import { useState as n, useCallback as i } from "react"; import "./index.es595.js"; function c() { const [t, o] = n(null), e = i(async (r) => { if (!(navigator != null && navigator.clipboard)) return console.warn("Clipboard not supported"), !1; try { return await navigator.clipboard.writeText(r), o(r), !0; } catch (a) { return console.warn("Copy failed", a), o(null), !1; } }, []); return [t, e]; } export { c as useCopyToClipboard }; //# sourceMappingURL=index.es503.js.map