18F/cg-dashboard

View on GitHub
static_src/components/action/button.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from "react";
import PropTypes from "prop-types";

const propTypes = {
  children: PropTypes.any,
  className: PropTypes.string,
  clickHandler: PropTypes.func,
  disabled: PropTypes.bool,
  label: PropTypes.string,
  type: PropTypes.string
};

const button = ({
  className,
  label,
  clickHandler,
  disabled,
  type,
  children
}) => (
  <button
    className={className}
    aria-label={label}
    onClick={clickHandler}
    disabled={disabled}
    type={type}
  >
    {children}
  </button>
);

button.propTypes = propTypes;

export default button;