parent
35a66d55d6
commit
2e19bdb964
@ -0,0 +1,23 @@
|
||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||
import {Row, Col, Button} from "reactstrap";
|
||||
|
||||
const ButtonWithIcon = ({icon, children, ...props}) => {
|
||||
if (icon) {
|
||||
return <Button {...props}>
|
||||
<Row className='gx-2 align-items-end'>
|
||||
<Col className='col-auto'>
|
||||
<FontAwesomeIcon icon={icon} />
|
||||
</Col>
|
||||
<Col className='col-auto'>
|
||||
{children}
|
||||
</Col>
|
||||
</Row>
|
||||
</Button>
|
||||
}
|
||||
|
||||
else {
|
||||
return (<Button {...props}>{children}</Button>)
|
||||
}
|
||||
}
|
||||
|
||||
export default ButtonWithIcon
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.6 KiB |
Loading…
Reference in new issue