"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Examples=Examples,exports.getSerializedValue=getSerializedValue;const jsx_runtime_1=require("react/jsx-runtime"),common_1=require("../common"),utils_1=require("../../utils"),styled_1=require("./styled"),hooks_1=require("../../hooks"),Markdown_1=require("../Markdown");function Examples({field:e}){const r=(0,hooks_1.useTranslate)();return e.examples?(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsxs)(common_1.FieldLabel,{children:[" ",r("openapi.examples","Examples"),": "]}),(0,jsx_runtime_1.jsx)(styled_1.ExamplesList,{children:Object.entries(e.examples).map((([r,s])=>{const i=(0,utils_1.normalizeText)(s.description);return(0,jsx_runtime_1.jsxs)(styled_1.ExampleWrap,{children:[(0,jsx_runtime_1.jsxs)(styled_1.ExampleSummary,{children:[(0,utils_1.normalizeText)(s.summary)||r," "]}),i&&(0,jsx_runtime_1.jsx)(Markdown_1.Markdown,{source:i}),(0,jsx_runtime_1.jsx)(common_1.ExampleValue,{children:getSerializedValue(e,s.value)})]},r)}))})]}):null}function getSerializedValue(e,r){return e.in?(0,utils_1.tryDecodeURIComponent)((0,utils_1.serializeParameterValue)(e,r)):r}
//# sourceMappingURL=Examples.js.map