import{bI as c,r as e}from"./index-DNBEEyYo.js";const n=()=>{const t=c(),[o,r]=e.useState(!1),a=e.useCallback(async s=>navigator.clipboard.writeText(s).then(()=>(r(!0),!0)).catch(()=>(t.error({title:"Error",content:"Failed to copy password."}),!1)).finally(()=>{setTimeout(()=>r(!1),2e3)}),[t]);return e.useMemo(()=>({copyToClipboard:a,copied:o}),[a,o])};export{n as u};
