import{r}from"./vendor-react-wBh_31cN.js";import{u as s}from"./useNotifier-BCEAoFCf.js";const d=()=>{const t=s(),[a,c]=r.useState(!1),l=r.useCallback(async(o,e)=>navigator.clipboard.writeText(o).then(()=>(c(!0),e!=null&&e.silent||t.success({title:(e==null?void 0:e.successTitle)??"Copied to clipboard",content:""}),!0)).catch(()=>(t.error({title:"Copy failed",content:"Could not write to the clipboard."}),!1)).finally(()=>{setTimeout(()=>c(!1),2e3)}),[t]);return r.useMemo(()=>({copyToClipboard:l,copied:a}),[l,a])};export{d as u};
