"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExternalExample=void 0;const jsx_runtime_1=require("react/jsx-runtime"),theme_1=require("@redocly/theme"),useExternalExample_1=require("./useExternalExample"),ExampleValue_1=require("./ExampleValue");function ExternalExample({example:e,mimeType:r,onCopyClick:l}){const a=(0,useExternalExample_1.useExternalExample)(e,r);return void 0===a?(0,jsx_runtime_1.jsx)("span",{children:"Loading..."}):a instanceof Error?(0,jsx_runtime_1.jsxs)(theme_1.CodeBlockContainer,{children:["Error loading external example: ",(0,jsx_runtime_1.jsx)("br",{}),(0,jsx_runtime_1.jsx)("a",{className:"token string",href:e.externalValueUrl,target:"_blank",rel:"noopener noreferrer",children:e.externalValueUrl})]}):(0,jsx_runtime_1.jsx)(ExampleValue_1.ExampleValue,{value:a,mimeType:r,onCopyClick:l})}exports.ExternalExample=ExternalExample;
//# sourceMappingURL=ExternalExample.js.map