@redocly/asyncapi-docs
Version:
Async API docs for Redocly Realm
4 lines (3 loc) • 1.15 kB
JavaScript
import{jsx as r,jsxs as e}from"react/jsx-runtime";import{useAtomValue as t}from"jotai";import{useCallback as p,memo as c}from"react";import f from"styled-components";import{ThreePanelLayout as u}from"@redocly/theme/layouts/ThreePanelLayout";import{RightPanel as d}from"./RightPanel.js";import{TagBlock as g}from"./TagBlock.js";import{ApiInfo as h}from"./ApiInfo.js";import{ChannelSection as v}from"./ChannelSection.js";import{MarkdownSection as y}from"./MarkdownSection.js";import{SectionWrapper as A}from"./common/index.js";import{layoutAtom as k,routingBasePathAtom as x,definitionAtom as S}from"../jotai-store/app.js";import{useAutoScroll as P}from"../hooks/index.js";const R=c(({apiItems:n})=>{const a=t(x),i=t(S);P(a);const l=t(k),m=p(o=>o?.type==="tag"?r(g,{tag:o},o.link):o?.type==="channel"?r(v,{item:o},o.link):null,[]);return e(u,{className:"api-content",id:"api-content",layout:l,collapsedSidebar:!0,children:[e(j,{rightPanel:r(d,{info:i.info,servers:i.servers}),children:[r(h,{}),n.filter(({type:o})=>o==="markdown").map((o,s)=>r(y,{item:o},s))]}),n.map(m)]})}),j=f(A)`
padding-bottom: var(--spacing-xl);
`;export{R as AsyncApiDocs};