import{jsx as r}from"react/jsx-runtime";import s from"../icons/ico-checkmark.js";import f from"../icons/ico-copy.js";import{useState as u,useEffect as d,useCallback as x}from"react";import c from"../primitives/button.js";const a=({value:t,showText:n,color:l,onCopy:m})=>{const e=l||"var(--color-text-primary)",[o,i]=u(!1);d(()=>{o&&setTimeout(()=>{i(!1)},2500)},[o]);const p=x(()=>{m(t),i(!0)},[t]);return r(c,{label:n?o?"Copied!":"Copy":void 0,variant:"text",onPress:p,iconSize:o?12:16,children:r(c.LeadingIcon,{children:o?r(s,{color:e}):r(f,{color:e})})})};a.displayName="CopyButton";export{a as default};
//# sourceMappingURL=copy-button.js.map
