import React from 'react' ; import { makeStyles , Theme , Button } from '@material-ui/core' ; import { ButtonProps } from '@material-ui/core/Button' ; import { AdapterLink } from './' ; const useStyles = makeStyles ( ( theme ) => ( { root : { width : '100%' , borderRadius : theme . spacing ( 4 ) , padding : theme . spacing ( 1.5 ) } } ) ) ; interface Props extends ButtonProps { to ? : string ; } const CallToAction = ( props ) => { const classes = useStyles ( ) ; return ( < Button { ... ( props . to && { component : AdapterLink } ) } className = { classes . root } variant = 'contained' color = 'primary' size = 'large' { ... props } />); } ; export default CallToAction ;