import{bL as x,u as j,r as f,j as e,L as p,B as t,aX as g,b as v,bj as b,m as k,bs as S,aK as y,s as B}from"./index-dP1W1_bd.js";import{h as K}from"./index-D4-3j93o.js";import{u as L}from"./useKafkaSubjects-BmqeePeS.js";const V=()=>{var o;const n=x(),{subjectName:s,id:i}=j(),{getSubjectByName:c,isLoading:l}=L(),[r,m]=f.useState(0),a=c(s),{data:u={}}=K({version:a==null?void 0:a.versions[r],subjectName:s,projectId:i},{skip:!a}),d=()=>n(B.project.settings.kafka.view);return l?e.jsx(p,{}):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(v,{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(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};
