import{b2 as x,u as j,r as p,j as e,a$ as f,Q as t,hp as g,x as S,be as b,E as k,aN as v,cR as y,b as N}from"./index-ea7817a2.js";import{h as C}from"./index-b96fda11.js";import{u as K}from"./useKafkaSubjects-3bc62c78.js";const V=()=>{var o;const n=x(),{subjectName:s,id:i}=j(),{getSubjectByName:c,isLoading:l}=K(),[r,m]=p.useState(0),a=c(s),{data:u={}}=C({version:a==null?void 0:a.versions[r],subjectName:s,projectId:i},{skip:!a}),d=()=>n(N.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(S,{fontSize:"18px",gray:!0,mr:"20px",bold:!0,children:s}),e.jsx(b,{value:"Kafka Schema",variant:"light",mode:"bordered",children:"Kafka Schema"})]}),e.jsx(k,{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(y,{copyButton:!0,downloadButton:!0,language:"json",minHeight:"320px",title:"avro schema",content:JSON.stringify(u,null,4)})]})})]})};export{V as default};
