UNPKG

react-dazzle

Version:

The simple yet flexible dashbording solution for React

33 lines (27 loc) 703 B
import React from 'react'; import PropTypes from 'prop-types'; /** * Default AddWidget component. * @param {[type]} {text [description] * @param {[type]} onClick} [description] * @return {[type]} [description] */ const AddWidget = ({ text, onClick }) => ( <div className="add-widget-button" onClick={onClick}> <a className="add-widget-link">{text}</a> </div> ); AddWidget.propTypes = { /** * Should be called when 'add' is clicked */ onClick: PropTypes.func, /** * Text that should be displyed in the component */ text: PropTypes.string, }; AddWidget.defaultProps = { text: 'Add Widget', }; export default AddWidget;