import{bg as x,u as j,r as f,j as e,L as g,d as t,f_ as p,y as b,aN as k,Q as v,a$ as S,cu as y,q as K}from"./index-CK33qGU_.js";import{h as N}from"./index-CBcuRugC.js";import{u as C}from"./useKafkaSubjects-BADlktnE.js";const V=()=>{var o;const n=x(),{subjectName:s,id:i}=j(),{getSubjectByName:c,isLoading:l}=C(),[r,m]=f.useState(0),a=c(s),{data:u={}}=N({version:a==null?void 0:a.versions[r],subjectName:s,projectId:i},{skip:!a}),d=()=>n(K.project.settings.kafka.view);return l?e.jsx(g,{}):e.jsxs(t,{flexDirection:"column",children:[e.jsx(p,{mr:"auto",mode:"highlight",onClick:d,children:"<- back to all Kafka Schemas"}),e.jsxs(t,{my:"20px",alignItems:"center",children:[e.jsx(b,{fontSize:"18px",gray:!0,mr:"20px",bold:!0,children:s}),e.jsx(k,{value:"Kafka Schema",variant:"light",mode:"bordered",children:"Kafka Schema"})]}),e.jsx(v,{title:"Schema versions",children:e.jsxs(t,{flexDirection:"column",children:[e.jsx(S.Controlled,{mb:"8px",activeTab:r,tabs:(o=a==null?void 0:a.versions)==null?void 0:o.map(h=>({title:`version ${h}`})),onTabChange:m}),e.jsx(y,{copyButton:!0,downloadButton:!0,language:"json",minHeight:"320px",title:"avro schema",content:JSON.stringify(u,null,4)})]})})]})};export{V as default};
