import{_ as i,d as _,k as l,o as c,c as u,f as p,j as d}from"./entry-d195bacb.mjs";import{u as f}from"./index-6e2e2ed7.mjs";import"./index-c5cfdf94.mjs";const m=_({name:"CopyButton",props:{content:{type:String,default:""}},setup(a,{expose:s}){s();const n=a,{copy:o}=f(),t=l("init"),e={props:n,copyToClipboard:o,state:t,copy:x=>{o(n.content).then(()=>{t.value="copied",setTimeout(()=>{t.value="init"},1e3)}).catch(()=>{console.warn("Couldn't copy to clipboard!")})}};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}});function y(a,s,n,o,t,r){const e=d;return c(),u("button",{class:"copy rounded-lg bg-gray-900 px-2 py-2 font-mono text-xs font-semibold leading-none text-gray-400 focus:outline-none",onClick:o.copy},[o.state==="copied"?(c(),p(e,{key:0,name:"fa-check",class:"h-4 w-4"})):(c(),p(e,{key:1,name:"fa-copy",class:"h-4 w-4"}))])}var h=i(m,[["render",y]]);export{h as default};
