@redocly/asyncapi-docs
Version:
Async API docs for Redocly Realm
2 lines (1 loc) • 3.48 kB
JavaScript
var g=function(o,c){var s={};for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&c.indexOf(i)<0&&(s[i]=o[i]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,i=Object.getOwnPropertySymbols(o);a<i.length;a++)c.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(o,i[a])&&(s[i[a]]=o[i[a]]);return s};import{Fragment as u,jsx as n,jsxs as t}from"react/jsx-runtime";import{useState as m}from"react";import{JsonViewer as b}from"@redocly/theme/components/JsonViewer/JsonViewer";import{BindingPanel as y,HeaderWrapper as l,TagStyled as d,TopicConfiguration as r,TopicConfigurationWrapper as C,MoreDetailsButton as j}from"./common/index.js";import{useProtocolLabels as x}from"../hooks/index.js";const B=({binding:o})=>{const[c,s]=m(!1),{getProtocolLabel:i}=x({amqp:Object.assign({},o.value||{})}),a=()=>{s(!c)},p=({key:h,value:e})=>{const{bindingVersion:O}=e,f=g(e,["bindingVersion"]);return h==="kafka"?t(u,{children:[e.topic&&t(l,{children:[n("span",{"data-testid":"topic-label",children:"Topic"}),n("span",{children:n(d,{borderless:!0,"data-testid":"topic-value",children:e.topic})})]}),e.partitions&&t(l,{children:[n("span",{"data-testid":"partitions-label",children:"Partitions"}),n("span",{children:n(d,{borderless:!0,color:"blue","data-testid":"partitions-value",children:e.partitions})})]}),e.replicas&&t(l,{children:[n("span",{"data-testid":"replicas-label",children:"Replicas"}),n("span",{children:n(d,{borderless:!0,color:"green","data-testid":"replicas-value",children:e.replicas})})]}),e.topicConfiguration&&t("div",{children:[n(l,{expandable:!0,onClick:a,children:n(j,{expanded:c})}),c&&t(C,{children:[e.topicConfiguration["cleanup.policy"]&&t(r,{children:[n("span",{children:"\u0421leanup policy"}),n("span",{children:e.topicConfiguration["cleanup.policy"].join(", ")})]}),e.topicConfiguration["retention.ms"]&&t(r,{children:[n("span",{children:"Retention, ms"}),n("span",{children:e.topicConfiguration["retention.ms"]})]}),e.topicConfiguration["retention.bytes"]&&t(r,{children:[n("span",{children:"Retention, bytes"}),n("span",{children:e.topicConfiguration["retention.bytes"]})]}),e.topicConfiguration["delete.retention.ms"]&&t(r,{children:[n("span",{children:"Delete retention, ms"}),n("span",{children:e.topicConfiguration["delete.retention.ms"]})]}),e.topicConfiguration["max.message.bytes"]&&t(r,{children:[n("span",{children:"Max message bytes"}),n("span",{children:e.topicConfiguration["max.message.bytes"]})]}),e.topicConfiguration["confluent.key.schema.validation"]&&t(r,{children:[n("span",{children:"Confluent key schema validation"}),n("span",{children:String(e.topicConfiguration["confluent.key.schema.validation"])})]}),e.topicConfiguration["confluent.key.subject.name.strategy"]&&t(r,{children:[n("span",{children:"Confluent key subject name strategy"}),n("span",{children:e.topicConfiguration["confluent.key.subject.name.strategy"]})]}),e.topicConfiguration["confluent.value.schema.validation"]&&t(r,{children:[n("span",{children:"Confluent value schema validation"}),n("span",{children:String(e.topicConfiguration["confluent.value.schema.validation"])})]}),e.topicConfiguration["confluent.value.subject.name.strategy"]&&t(r,{children:[n("span",{children:"Confluent value subject name strategy"}),n("span",{children:e.topicConfiguration["confluent.value.subject.name.strategy"]})]})]})]})]}):n(b,{data:f,expandLevel:3,controls:!1})};return n(y,{header:i("channelBinding"),children:p(o)})};export{B as ChannelBinding};