import{jsx as o,jsxs as p}from"react/jsx-runtime";import{useMemo as l,useState as m}from"react";import{Button as c}from"@redocly/theme/components/Button/Button";import{Markdown as d}from"../../Markdown/index.js";import{ExampleValue as x}from"../Fields/index.js";import{useTranslate as E}from"../../../hooks/index.js";import{styled as a}from"../../../styled-components.js";const f=150;function A({value:e}){const s=E(),[n,i]=m(!1),t=l(()=>e.slice(0,f),[e]),r=()=>{i(!n)};return p(u,{children:[o(d,{source:n?e:t}),(e!==t||n)&&o(h,{children:o(c,{variant:"link",size:"small",onClick:r,children:n?s("openapi.hideExample","Hide example"):s("openapi.showExample","Show example")})})]})}const u=a(x)`
  display: inline;

  & * {
    display: inline;
  }
`,h=a.span`
  margin-left: var(--spacing-xs);
`;export{A as ExpandableExample};
