import{jsxs as n,jsx as e,Fragment as s}from"react/jsx-runtime";import{memo as a}from"react";import{Markdown as h}from"../Markdown/index.js";import{DescriptionEnumsBlock as u}from"./styled.js";import{ToggleButton as f}from"../common/index.js";import{styled as t}from"../../styled-components.js";const y=t.td`
  word-wrap: break-word;
  font-size: var(--md-table-font-size);
`,g=t.td`
  & p,
  p:only-of-type {
    margin: 0;
  }
`;function x({enums:o,toggle:l,showToggleButton:p,toggleButtonText:c,type:d,translate:r}){return e(s,{children:e(u,{children:n("table",{className:"md",children:[e("thead",{children:n("tr",{children:[n("th",{style:{width:"30%"},children:[d==="array"?r("openapi.items","Items"):""," ",o.length===1?r("openapi.value","Value"):`${r("openapi.enum","Enum")} ${r("openapi.value","Value")}`]}),e("th",{children:r("openapi.description","Description")})]})}),e("tbody",{children:o.map(({description:m,value:i})=>n("tr",{children:[e(y,{children:i}),e(g,{children:e(h,{source:m})})]},i))}),p?e("tfoot",{children:e("tr",{children:e("td",{colSpan:2,children:e(f,{onClick:l,children:c})})})}):null]})})})}const V=a(x);export{V as DescriptionEnums,x as DescriptionEnumsComponent};
