import{j as o,u as d}from"./fields-wnm5Jtc6.js";import{a as u}from"./vendor-D21mNUGX.js";import{P as e,bZ as m,I as b,J as h}from"./index-pmrLY__j.js";import{F as f}from"./index-kc5wfrYu.js";import{n as x}from"./Layout-CFk9FOHT.js";const g=({code:t,height:i=300,editable:p=!0,copyToClipboard:n=!0,language:l})=>{const[r,c]=u.useState(t);let a={selectOnLineNumbers:!0};return p===!1&&(a.readOnly=!0),o.jsxs("div",{className:"acpt-code",children:[o.jsx(f,{value:t,height:i+"px",theme:"vs-dark",onChange:s=>{c(s)},language:l,options:a}),n&&o.jsx("button",{className:"copy-to-clipboard",onClick:s=>{s.preventDefault(),m(typeof r>"u"?t:r),x.success(d("Copied to the clipboard!"))},children:o.jsx(b,{icon:"bx:copy",color:h(),width:24})})]})};g.propTypes={language:e.string.isRequired,code:e.string.isRequired,height:e.string,editable:e.bool,copyToClipboard:e.bool};export{g as C};
