bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/connection-status/icon/component.jsx

31 lines
586 B
React
Raw Normal View History

2021-11-17 20:26:26 +08:00
import React from 'react';
import Styled from './styles';
const STATS = {
critical: {
bars: 1,
},
danger: {
bars: 2,
},
warning: {
bars: 3,
},
normal: {
bars: 4,
},
};
const Icon = ({ level, grayscale }) => (
<>
2022-04-09 03:05:29 +08:00
<Styled.SignalBars id="connectionBars" level={level} grayscale={grayscale}>
<Styled.FirstBar />
<Styled.SecondBar active={STATS[level].bars >= 2} />
<Styled.ThirdBar active={STATS[level].bars >= 3} />
<Styled.FourthBar active={STATS[level].bars >= 4} />
</Styled.SignalBars>
</>
);
export default Icon;