import{r as f,j as a}from"./vendor-react-wBh_31cN.js";import{B as p}from"./back-button-zYdlGpWP.js";import{B as j}from"./badge-nyizWwTN.js";import{C as h,a as g,b,c as v}from"./card-DISTA6Ay.js";import{C as N}from"./code-BepIAQDJ.js";import{aq as k,R as S,r as C}from"./index-BKr2rJhV.js";import{T as B,a as y,b as T}from"./tabs-DF7ID_Y6.js";import{u as K}from"./useProjectNavigate-5znX7Ojg.js";import{g as L}from"./index-470EV_bO.js";import{u as V}from"./useKafkaSubjects-DGn3LqQ3.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};
