import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useMemo}from"react";import{Markdown as MarkdownWrapper,H3,isNotNull}from"@redocly/theme";const FILTER_OUT_KEYS=["title","description"];function metadataMap([e,t]){return FILTER_OUT_KEYS.includes(e)?null:Array.isArray(t)?{key:e,value:t.filter((e=>"object"!=typeof e)).join(", ")}:"object"==typeof t?null:{key:e,value:t}}export function Metadata({metadata:e}){const t=useMemo((()=>Object.entries(e||{}).map(metadataMap).filter(isNotNull)),[e]);return e?_jsxs(MarkdownWrapper,{children:[_jsx(H3,{children:"Metadata"}),_jsxs("table",{className:"md",children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{scope:"col",children:"Key"}),_jsx("th",{scope:"col",children:"Value"})]})}),_jsx("tbody",{children:t.map((({key:e,value:t})=>_jsxs("tr",{children:[_jsx("td",{children:e}),_jsx("td",{children:`${t}`})]},e)))})]})]}):null}
//# sourceMappingURL=Metadata.js.map