UNPKG

@massds/mayflower-react

Version:

React versions of Mayflower design system UI components

22 lines 812 B
/** * ButtonSort module. * @module @massds/mayflower-react/ButtonSort * @requires module:@massds/mayflower-assets/scss/01-atoms/button-sort */ import React from "react"; import PropTypes from "prop-types"; const ButtonSort = buttonSort => { const buttonSortClass = buttonSort.direction ? " ma__button-sort--" + buttonSort.direction : ''; const classNames = "ma__button-sort js-button-sort" + buttonSortClass; return /*#__PURE__*/React.createElement("button", { type: "button", className: classNames }, buttonSort.text); }; ButtonSort.propTypes = process.env.NODE_ENV !== "production" ? { /** The label text of the sort button */ text: PropTypes.string.isRequired, /** An array of sort button objects */ direction: PropTypes.oneOf(['', 'asc', 'dsc']) } : {}; export default ButtonSort;