UNPKG

@redocly/asyncapi-docs

Version:

Async API docs for Redocly Realm

2 lines (1 loc) 1.32 kB
var l=function(t,i){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&i.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,r=Object.getOwnPropertySymbols(t);e<r.length;e++)i.indexOf(r[e])<0&&Object.prototype.propertyIsEnumerable.call(t,r[e])&&(n[r[e]]=t[r[e]]);return n};import{Fragment as g,jsx as s,jsxs as u}from"react/jsx-runtime";import{useAtomValue as h}from"jotai";import{makeDeepLink as b}from"@redocly/openapi-docs";import{JsonViewer as y}from"@redocly/theme/components/JsonViewer/JsonViewer";import{combineUrls as O}from"@redocly/theme/core/openapi";import{BindingPanel as j}from"./common/index.js";import{JsonSchema as a}from"./JsonSchema.js";import{getSchema as c}from"../utils/index.js";import{routingBasePathAtom as I}from"../jotai-store/app.js";const J=({binding:t,id:i})=>{const n=h(I),r=O(n,b(i,""));return s(j,{header:"Operation configuration",children:(({key:p,value:o})=>{const{bindingVersion:x}=o,m=l(o,["bindingVersion"]);if(p==="kafka"){const d={type:"object",properties:{groupId:c(o.groupId)}},f={type:"object",properties:{clientId:c(o.clientId)}};return u(g,{children:[o.groupId&&s(a,{schema:d,slug:r}),o.clientId&&s(a,{schema:f,slug:r})]})}else return s(y,{data:m,expandLevel:3,controls:!1})})(t)})};export{J as OperationBinding};