/* global React */ import { addons } from 'react/addons'; import FontIcon from '../font_icon'; import Ripple from '../ripple'; import style from './style.scss'; export default React.createClass({ mixins: [addons.PureRenderMixin], displayName: 'Button', propTypes: { className: React.PropTypes.string, disabled: React.PropTypes.bool, icon: React.PropTypes.string, primary: React.PropTypes.bool, accent: React.PropTypes.bool, label: React.PropTypes.string, loading: React.PropTypes.bool, ripple: React.PropTypes.bool, type: React.PropTypes.string }, getDefaultProps () { return { className: '', ripple: true, type: 'flat' }; }, getInitialState () { return { loading: this.props.loading }; }, handleMouseDown (event) { this.refs.ripple.start(event); }, render () { let className = style[this.props.type]; if (this.props.className) className += ` ${this.props.className}`; return ( ); }, loading (value) { this.setState({loading: value}); } });