import{bJ as x,u as j,r as g,j as e,L as p,B as t,gP as f,c as b,bb as k,y as v,bk as S,c_ as y,s as B}from"./index-C1DmWO_C.js";import{h as K}from"./index-CxmfBMSc.js";import{u as N}from"./useKafkaSubjects-yrv5Kxme.js";const P=()=>{var n;const o=x(),{subjectName:s,id:i}=j(),{getSubjectByName:c,isLoading:l}=N(),[r,m]=g.useState(0),a=c(s),{data:u={}}=K({version:a==null?void 0:a.versions[r],subjectName:s,projectId:i},{skip:!a}),d=()=>o(B.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(v,{title:"Schema versions",children:e.jsxs(t,{flexDirection:"column",children:[e.jsx(S.Controlled,{mb:"8px",activeTab:r,tabs:(n=a==null?void 0:a.versions)==null?void 0:n.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{P as default};
