Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
`;
const propTypes = {
/** Show loading spinner, only new prop */
loading: PropTypes.bool,
/** Disable the button will be auto disabled when loading */
disabled: PropTypes.bool,
/** Button label */
children: PropTypes.node.isRequired,
/** click handler */
onClick: PropTypes.func.isRequired,
className: PropTypes.string,
/** primary, secondary, etc from carbon */
kind: ButtonTypes.buttonKind,
};
const defaultProps = {
loading: false,
disabled: false,
className: null,
kind: 'primary',
};
/**
* Carbon button with added ability to show loading state
*/
const ButtonEnhanced = props => {
const { children, loading, disabled, className, ...other } = props;
return (
PropTypes.node,
]),
afterContent: PropTypes.node,
thumbnail: PropTypes.node,
href: PropTypes.string,
})
),
})
).isRequired,
classNameGalleryItem: PropTypes.string,
/** Is button disabled */
isButtonDisabled: PropTypes.bool,
/** Custom className for Button component */
buttonClassName: PropTypes.string,
/** Button kind */
buttonKind: ButtonTypes.buttonKind,
/** Button content */
buttonText: PropTypes.string,
};
const defaultProps = {
description: null,
hasSearch: false,
hasSwitcher: false,
hasButton: false,
i18n: {
searchIconDescription: 'Search',
searchPlaceHolderText: 'Search for something',
searchCloseButtonText: 'Clear search',
listText: 'List',
gridText: 'Grid',
arrowIconDescription: 'Expand/Collapse',