mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 19:51:08 +08:00
22 lines
396 B
JavaScript
22 lines
396 B
JavaScript
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
|
|
const Button = ({ disabled, label, onClick }) => (
|
|
<button disabled={disabled} onClick={onClick}>
|
|
{label}
|
|
</button>
|
|
);
|
|
|
|
Button.propTypes = {
|
|
label: PropTypes.string.isRequired,
|
|
disabled: PropTypes.bool,
|
|
onClick: PropTypes.func,
|
|
};
|
|
|
|
Button.defaultProps = {
|
|
disabled: false,
|
|
onClick() {},
|
|
};
|
|
|
|
export default Button;
|