summaryrefslogtreecommitdiff
path: root/src/components/Button.js
blob: eb50ffd5989c21e393fd1b7ee62d6669a09728fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import React from 'react';
import PropTypes from 'prop-types';

import s0 from 'c/Button.module.scss';
const noop = () => {};

const Button = React.memo(function Button({ label, onClick = noop }) {
  return (
    <button className={s0.btn} onClick={onClick}>
      {label}
    </button>
  );
});

Button.propTypes = {
  label: PropTypes.string.isRequired,
  onClick: PropTypes.func
};

export default Button;