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