| 1 |
import React from 'react'; |
| 2 |
import cx from 'classnames'; |
| 3 |
|
| 4 |
import styles from './GreenButton.module.css'; |
| 5 |
|
| 6 |
export default function GreenButton({as: Element = 'button', text, className, shadow = false, ...props}) { |
| 7 |
const classes = cx(styles.button, shadow && styles.shadow, className); |
| 8 |
|
| 9 |
if (Element === 'input') { |
| 10 |
return <input type="submit" value={text} className={classes} {...props} />; |
| 11 |
} |
| 12 |
|
| 13 |
return ( |
| 14 |
<Element type="submit" className={classes} {...props}> |
| 15 |
{text} |
| 16 |
</Element> |
| 17 |
); |
| 18 |
} |
| 19 |
|