"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Metadata=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),theme_1=require("@redocly/theme"),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}}function Metadata({metadata:e}){const t=(0,react_1.useMemo)((()=>Object.entries(e||{}).map(metadataMap).filter(theme_1.isNotNull)),[e]);return e?(0,jsx_runtime_1.jsxs)(theme_1.Markdown,{children:[(0,jsx_runtime_1.jsx)(theme_1.H3,{children:"Metadata"}),(0,jsx_runtime_1.jsxs)("table",{className:"md",children:[(0,jsx_runtime_1.jsx)("thead",{children:(0,jsx_runtime_1.jsxs)("tr",{children:[(0,jsx_runtime_1.jsx)("th",{scope:"col",children:"Key"}),(0,jsx_runtime_1.jsx)("th",{scope:"col",children:"Value"})]})}),(0,jsx_runtime_1.jsx)("tbody",{children:t.map((({key:e,value:t})=>(0,jsx_runtime_1.jsxs)("tr",{children:[(0,jsx_runtime_1.jsx)("td",{children:e}),(0,jsx_runtime_1.jsx)("td",{children:`${t}`})]},e)))})]})]}):null}exports.Metadata=Metadata;
//# sourceMappingURL=Metadata.js.map