|  |  |  | 
|---|
|  |  |  | import * as React from 'react'; | 
|---|
|  |  |  | import { Paper, Typography, Box, Chip, Avatar } from '@mui/material'; | 
|---|
|  |  |  | import { teal } from '@mui/material/colors'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const PulseSignal = (props) => { | 
|---|
|  |  |  | const { flag = true, width = 8, ...rest } = props; | 
|---|
|  |  |  | const { flag = true, width = 8, negative = false, ...rest } = props; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <> | 
|---|
|  |  |  | <Box | 
|---|
|  |  |  | {...rest} | 
|---|
|  |  |  | sx={{ | 
|---|
|  |  |  | width: width, | 
|---|
|  |  |  | height: width, | 
|---|
|  |  |  | borderRadius: '50%', | 
|---|
|  |  |  | backgroundColor: flag ? '#3f51b5' : '#f44336', | 
|---|
|  |  |  | display: 'inline-block', | 
|---|
|  |  |  | animation: 'pulse 1.5s infinite', | 
|---|
|  |  |  | '@keyframes pulse': { | 
|---|
|  |  |  | '0%': { | 
|---|
|  |  |  | transform: 'scale(1)', | 
|---|
|  |  |  | opacity: 1, | 
|---|
|  |  |  | {flag ? ( | 
|---|
|  |  |  | <Box | 
|---|
|  |  |  | {...rest} | 
|---|
|  |  |  | sx={{ | 
|---|
|  |  |  | width: width, | 
|---|
|  |  |  | height: width, | 
|---|
|  |  |  | borderRadius: '50%', | 
|---|
|  |  |  | backgroundColor: `${teal[400]}`, | 
|---|
|  |  |  | display: 'inline-block', | 
|---|
|  |  |  | animation: `pulse ${negative ? '2' : '1.2'}s infinite`, | 
|---|
|  |  |  | '@keyframes pulse': { | 
|---|
|  |  |  | '0%': { | 
|---|
|  |  |  | transform: 'scale(1)', | 
|---|
|  |  |  | opacity: 1, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '50%': { | 
|---|
|  |  |  | transform: 'scale(1.3)', | 
|---|
|  |  |  | opacity: 0.7, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '100%': { | 
|---|
|  |  |  | transform: 'scale(1)', | 
|---|
|  |  |  | opacity: 1, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '50%': { | 
|---|
|  |  |  | transform: 'scale(1.2)', | 
|---|
|  |  |  | opacity: 0.7, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '100%': { | 
|---|
|  |  |  | transform: 'scale(1)', | 
|---|
|  |  |  | opacity: 1, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | ) : ( | 
|---|
|  |  |  | <Box | 
|---|
|  |  |  | {...rest} | 
|---|
|  |  |  | sx={{ | 
|---|
|  |  |  | width: width + width / 10, | 
|---|
|  |  |  | height: width + width / 10, | 
|---|
|  |  |  | borderRadius: '50%', | 
|---|
|  |  |  | backgroundColor: '#f44336', | 
|---|
|  |  |  | display: 'inline-block', | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | )} | 
|---|
|  |  |  | </> | 
|---|
|  |  |  | ) | 
|---|
|  |  |  |  | 
|---|