import{b1 as x,u as j,r as p,j as e,a_ as f,a as t,hp as g,c as k,bd as S,K as b,aM as v,cO as K,e as y}from"./index-d6499a22.js";import{h as N}from"./index-0e1d5e0b.js";import{u as B}from"./useKafkaSubjects-67007d33.js";const D=()=>{var o;const n=x(),{subjectName:s,id:i}=j(),{getSubjectByName:c,isLoading:l}=B(),[r,m]=p.useState(0),a=c(s),{data:u={}}=N({version:a==null?void 0:a.versions[r],subjectName:s,projectId:i},{skip:!a}),d=()=>n(y.project.settings.kafka.view);return l?e.jsx(f,{}):e.jsxs(t,{flexDirection:"column",children:[e.jsx(g,{mr:"auto",mode:"highlight",onClick:d,children:"<- back to all Kafka Schemas"}),e.jsxs(t,{my:"20px",alignItems:"center",children:[e.jsx(k,{fontSize:"18px",gray:!0,mr:"20px",bold:!0,children:s}),e.jsx(S,{value:"Kafka Schema",variant:"light",mode:"bordered",children:"Kafka Schema"})]}),e.jsx(b,{title:"Schema versions",children:e.jsxs(t,{flexDirection:"column",children:[e.jsx(v.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(K,{copyButton:!0,downloadButton:!0,language:"json",minHeight:"320px",title:"avro schema",content:JSON.stringify(u,null,4)})]})})]})};export{D as default};
