import{jsxs as _jsxs,jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{Markdown}from"../Markdown";import{DescriptionEnumsBlock}from"./styled";import{ToggleButton}from"../common";const EnumValueStyled=styled.td`
  word-wrap: break-word;
  font-size: var(--md-table-font-size);
`,DescriptionValueStyled=styled.td`
  & p,
  p:only-of-type {
    margin: 0;
  }
`;export function DescriptionEnumsComponent({enums:e,toggle:t,showToggleButton:n,toggleButtonText:o,type:r}){return _jsx(_Fragment,{children:_jsx(DescriptionEnumsBlock,{children:_jsxs("table",{className:"md",children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsxs("th",{style:{width:"30%"},children:["array"===r?"Items":""," ",1===e.length?"Value":"Enum Value"]}),_jsx("th",{children:"Description"})]})}),_jsx("tbody",{children:e.map((({description:e,value:t})=>_jsxs("tr",{children:[_jsx(EnumValueStyled,{children:t}),_jsx(DescriptionValueStyled,{children:_jsx(Markdown,{source:e})})]},t)))}),n?_jsx("tfoot",{children:_jsx("tr",{children:_jsx("td",{colSpan:2,children:_jsx(ToggleButton,{onClick:t,children:o})})})}):null]})})})}export const DescriptionEnums=memo(DescriptionEnumsComponent);
//# sourceMappingURL=DescriptionEnums.js.map