import React, { Component } from 'react';
import {Link} from 'react-router-dom'

const map={"blue":"colorblue","white":"colorwhite","grey":"colorgrey", 'orange': "color-orange"}
class WordsBtn extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    let{to, href}=this.props
    return(
      <React.Fragment>
        {
          to==undefined ? 
          <a href={href || "javascript:void(0)"} onClick={this.props.onClick} className={"btn "+`${map[this.props.style]} ${this.props.className}`}>{this.props.children}</a>
          :
          <Link to={to} className={"btn "+`${map[this.props.style]} ${this.props.className}`}>{this.props.children}</Link>
        }
      </React.Fragment>
    )
  }
}
export default WordsBtn;