import {useState} from 'react'
import {Box, Button, Typography} from '@material-ui/core'
import {Signal} from '@icons-pack/react-simple-icons'

import SignalDialog from './signal-dialog'

export default function JwennSignal() {
  const [ouve, meteOuve] = useState(false)

  const handleClickOuve = () => {
    meteOuve(true)
  }

  const handleFemen = () => {
    meteOuve(false)
  }

  return (
    <>
      <Button style={{marginTop: 10}} variant='outlined' color='primary' onClick={handleClickOuve}>
        <Box paddingTop={1}>
          <Signal size={55} />
          <Typography style={{fontWeight: 'bold'}} variant='h6' component='h1'>
            Signal
          </Typography>
        </Box>
      </Button>
      {ouve && (
        <SignalDialog ouve={ouve} handleFemen={handleFemen} />
      )}
    </>
  )
}
