UNPKG

@redocly/asyncapi-docs

Version:

Async API docs for Redocly Realm

2 lines (1 loc) 1.09 kB
import{jsx as a,jsxs as m}from"react/jsx-runtime";import{useAtomValue as d}from"jotai";import{RightPanelContainer as c,Overview as p}from"@redocly/openapi-docs";import{Panel as i,Markdown as v,LayoutVariant as u}from"@redocly/theme";import h,{useMemo as w}from"react";import{ServersListPanel as x}from"./ServersListPanel";import{DownloadSpecification as y}from"./DownloadSpecification";import{layoutAtom as P}from"../jotai/app";import{useTranslate as S}from"../hooks";const C=h.memo(({info:e,servers:r})=>{const o=S(),t=w(()=>Object.entries(r||{}).map(([s,n])=>({key:s,value:n})),[r]),l=d(P)===u.STACKED;return m(c,{isStacked:l,"data-component-name":"RightPanel/RightPanel",children:[a(i,{className:"panel-download",header:o("asyncapi.download.description.title","Download AsycAPI description"),isExpandable:!1,children:a(y,{})}),(e?.license||e?.contact||e?.termsOfService)&&a(i,{className:"panel-overview",header:o("asyncapi.info.title","Overview"),isExpandable:!1,children:a(v,{children:a(p,{info:e,translate:o})})}),!!t?.length&&a(x,{servers:t,showDetails:!0})]})});export{C as RightPanel};