mirror of
https://github.com/thomasnordquist/MQTT-Explorer.git
synced 2026-09-12 01:23:31 +00:00
33 lines
683 B
TypeScript
33 lines
683 B
TypeScript
import * as React from 'react'
|
|
import Add from '@material-ui/icons/Add'
|
|
import { Fab } from '@material-ui/core'
|
|
import { Theme, withStyles } from '@material-ui/core/styles'
|
|
|
|
const styles = (theme: Theme) => ({
|
|
addButton: {
|
|
height: theme.spacing(4),
|
|
width: theme.spacing(4),
|
|
minHeight: '0',
|
|
},
|
|
addIcon: {
|
|
height: theme.spacing(2),
|
|
},
|
|
})
|
|
|
|
export const AddButton = withStyles(styles)((props: {
|
|
classes: any,
|
|
action: any,
|
|
}) => {
|
|
return (
|
|
<Fab
|
|
size="small"
|
|
color="secondary"
|
|
aria-label="Add"
|
|
className={props.classes.addButton}
|
|
onClick={props.action}
|
|
>
|
|
<Add className={props.classes.addIcon} />
|
|
</Fab>
|
|
)
|
|
})
|