"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DescriptionEnums=exports.DescriptionEnumsComponent=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),styled_components_1=__importDefault(require("styled-components")),Markdown_1=require("../Markdown"),styled_1=require("./styled"),common_1=require("../common"),EnumValueStyled=styled_components_1.default.td`
  word-wrap: break-word;
  font-size: var(--md-table-font-size);
`,DescriptionValueStyled=styled_components_1.default.td`
  & p,
  p:only-of-type {
    margin: 0;
  }
`;function DescriptionEnumsComponent({enums:e,toggle:t,showToggleButton:n,toggleButtonText:r,type:s}){return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:(0,jsx_runtime_1.jsx)(styled_1.DescriptionEnumsBlock,{children:(0,jsx_runtime_1.jsxs)("table",{className:"md",children:[(0,jsx_runtime_1.jsx)("thead",{children:(0,jsx_runtime_1.jsxs)("tr",{children:[(0,jsx_runtime_1.jsxs)("th",{style:{width:"30%"},children:["array"===s?"Items":""," ",1===e.length?"Value":"Enum Value"]}),(0,jsx_runtime_1.jsx)("th",{children:"Description"})]})}),(0,jsx_runtime_1.jsx)("tbody",{children:e.map((({description:e,value:t})=>(0,jsx_runtime_1.jsxs)("tr",{children:[(0,jsx_runtime_1.jsx)(EnumValueStyled,{children:t}),(0,jsx_runtime_1.jsx)(DescriptionValueStyled,{children:(0,jsx_runtime_1.jsx)(Markdown_1.Markdown,{source:e})})]},t)))}),n?(0,jsx_runtime_1.jsx)("tfoot",{children:(0,jsx_runtime_1.jsx)("tr",{children:(0,jsx_runtime_1.jsx)("td",{colSpan:2,children:(0,jsx_runtime_1.jsx)(common_1.ToggleButton,{onClick:t,children:r})})})}):null]})})})}exports.DescriptionEnumsComponent=DescriptionEnumsComponent,exports.DescriptionEnums=(0,react_1.memo)(DescriptionEnumsComponent);
//# sourceMappingURL=DescriptionEnums.js.map