mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
29 lines
728 B
JavaScript
29 lines
728 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
/** BaseButton component description imported from comments inside the component file */
|
|
const BaseButton = ({ disabled, label, onClick, style }) => (
|
|
<button type="button" disabled={disabled} onClick={onClick} style={style}>
|
|
{label}
|
|
</button>
|
|
);
|
|
|
|
BaseButton.defaultProps = {
|
|
disabled: false,
|
|
onClick: () => {},
|
|
style: {},
|
|
};
|
|
|
|
BaseButton.propTypes = {
|
|
/** Boolean indicating whether the button should render as disabled */
|
|
disabled: PropTypes.bool,
|
|
/** button label. */
|
|
label: PropTypes.string.isRequired,
|
|
/** onClick handler */
|
|
onClick: PropTypes.func,
|
|
/** Custom styles */
|
|
style: PropTypes.shape({}),
|
|
};
|
|
|
|
export default BaseButton;
|