import{r as f,j as a}from"./vendor-react-wBh_31cN.js";import{B as p}from"./back-button-CQo-pvZ0.js";import{B as j}from"./badge-UCnweWGd.js";import{C as h,a as g,b,c as v}from"./card-BeQtvmcJ.js";import{C as N}from"./code-BwgxKro-.js";import{aq as k,R as S,r as C}from"./index-dNe6i2rS.js";import{T as B,a as y,b as T}from"./tabs-BZDPsi5L.js";import{u as K}from"./useProjectNavigate-BM67yKhl.js";import{g as L}from"./index-DoDc9bBo.js";import{u as V}from"./useKafkaSubjects-BQ7CcrEP.js";import{c as E}from"./vendor-router-D1GqFWiT.js";import"./vendor-icons-BUUmD6ht.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-radix-BRyWS4bQ.js";import"./vendor-redux-CJZrIb6x.js";import"./vendor-grid-CeFlDWv4.js";const U=()=>{var o;const i=K(),{subjectName:e,id:c}=E(),{getSubjectByName:n,isLoading:m}=V(),[t,l]=f.useState(0),s=n(e),{data:d={}}=L({version:s==null?void 0:s.versions[t],subjectName:e,projectId:c},{skip:!s}),u=()=>i(C.project.settings.kafka.view);return m?a.jsx(k,{}):a.jsxs("div",{className:"flex flex-col",children:[a.jsx(p,{className:"mr-auto",onClick:u,children:"back to all Kafka Schemas"}),a.jsxs("div",{className:"my-5 flex items-center",children:[a.jsx(S,{bold:!0,gray:!0,className:"mr-5 text-lg",children:e}),a.jsx(j,{variant:"secondary",className:"border border-border",children:"Kafka Schema"})]}),a.jsxs(h,{children:[a.jsx(g,{children:a.jsx(b,{children:"Schema versions"})}),a.jsx(v,{children:a.jsxs("div",{className:"flex flex-col",children:[a.jsx(B,{value:String(t),onValueChange:r=>l(Number(r)),className:"mb-2",children:a.jsx(y,{children:(o=s==null?void 0:s.versions)==null?void 0:o.map((r,x)=>a.jsxs(T,{value:String(x),children:["version ",r]},r))})}),a.jsx(N,{copyButton:!0,language:"json",title:`${e}.avsc`,content:JSON.stringify(d,null,4)})]})})]})]})};export{U as default};
