UNPKG

@redocly/asyncapi-docs

Version:

Async API docs for Redocly Realm

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