UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

2 lines (1 loc) 388 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");exports.default=function(){const[t,r]=e.useState(!1),u=e.useRef(),c=e.useRef(!1);return e.useEffect((()=>(c.current=!0,()=>{c.current=!1})),[]),{copy:async e=>{try{r(!0),clearTimeout(u.current),u.current=setTimeout((()=>{c&&r(!1)}),1200),navigator.clipboard.writeText(e)}catch(e){}},isCopied:t}};