import{b9 as x,u as j,r as g,j as e,D as p,$ as t,gQ as f,c as b,b8 as k,b as S,bk as v,cM as y,q as K}from"./index-46ma1THH.js";import{h as N}from"./index-DIN48ET6.js";import{u as B}from"./useKafkaSubjects-ChuajI4E.js";const I=()=>{var r;const n=x(),{subjectName:s,id:i}=j(),{getSubjectByName:c,isLoading:l}=B(),[o,m]=g.useState(0),a=c(s),{data:u={}}=N({version:a==null?void 0:a.versions[o],subjectName:s,projectId:i},{skip:!a}),d=()=>n(K.project.settings.kafka.view);return l?e.jsx(p,{}):e.jsxs(t,{flexDirection:"column",children:[e.jsx(f,{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(S,{title:"Schema versions",children:e.jsxs(t,{flexDirection:"column",children:[e.jsx(v.Controlled,{mb:"8px",activeTab:o,tabs:(r=a==null?void 0:a.versions)==null?void 0:r.map(h=>({title:`version ${h}`})),onTabChange:m}),e.jsx(y,{copyButton:!0,downloadButton:!0,language:"json",minHeight:"320px",title:`${s}.avsc`,content:JSON.stringify(u,null,4)})]})})]})};export{I as default};
