import React from 'react'; import { Trans } from '@lingui/macro'; import Grid from '@mui/material/Grid'; import Typography from '@mui/material/Typography'; import Duration from '../../misc/Duration'; import Number from '../../misc/Number'; import Palette from '../../theme/base/palette'; export default function Progress(props) { const uptime = props.progress.time; const bitrate = props.progress.bitrate.toFixed(2); const fps = Math.round(props.progress.fps); const speed = props.progress.speed; const valueStyle = { fontWeight: 'bold', marginBottom: -5, }; const divStyle = { backgroundColor: Palette.background.box_default, textAlign: 'center', borderRadius: 4, padding: 8, marginTop: '.5em', marginBottom: '.2em', }; const uptimeStyle = { ...divStyle, }; const bitrateStyle = { ...divStyle, }; const fpsStyle = { ...divStyle, }; if (fps && (fps < 10 || speed < 1.0)) { fpsStyle.backgroundColor = Palette.background.box_danger; } else { fpsStyle.backgroundColor = Palette.background.box_default; } return (
Uptime
kbit/s
FPS
); } Progress.defaultProps = { progress: {}, };