import React from 'react';
import {ThemeProvider, Button as SButton, withRipple} from 'styled-material-components';

const ButtomBase = SButton.extend`
    ${props => props.width ? 'width: ' + props.width : ''}
`;

const Ripple = withRipple(ButtomBase);

var customprops = {};

class Buttom extends React.Component{
    constructor(props){
        super(props);

        customprops = {...this.props};
        delete customprops.theme;
    }
    render(){
        return (
            <ThemeProvider theme={this.props.theme}>
                <Ripple {...customprops} primary>
                    {this.props.children}
                </Ripple>
            </ThemeProvider>
        )
    }
}

export default Buttom;
