Files

43 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2022-05-25 06:39:09 +04:00
import PropTypes from 'prop-types'
import {styled} from '@mui/material/styles'
import Typography from '@mui/material/Typography'
import Box from '@mui/material/Box'
import LinearProgress, {linearProgressClasses} from '@mui/material/LinearProgress'
const BorderLinearProgress = styled(LinearProgress)(({theme}) => ({
height: 10,
borderRadius: 5,
[`&.${linearProgressClasses.colorPrimary}`]: {
2024-10-21 15:43:16 +04:00
backgroundColor: 200,
...theme.applyStyles('dark', {
backgroundColor: 800
})
2022-05-25 06:39:09 +04:00
},
[`& .${linearProgressClasses.bar}`]: {
borderRadius: 5,
2024-10-21 15:43:16 +04:00
backgroundColor: '#1a90ff',
...theme.applyStyles('dark', {
backgroundColor: '#308fe8'
})
2022-05-25 06:39:09 +04:00
},
}))
export default function BarStats({percent}) {
return (
<Box sx={{display: 'flex', alignItems: 'center'}}>
2022-06-04 01:38:19 +04:00
<Box sx={{width: '100%'}}>
2022-05-25 06:39:09 +04:00
<BorderLinearProgress variant='determinate' value={percent} />
</Box>
<Box sx={{minWidth: 35}}>
2022-06-04 01:38:19 +04:00
<Typography textAlign='right' sx={{fontWeight: 'bold'}} variant='body2' color='text.secondary'>{`${Math.round(
2022-05-25 06:39:09 +04:00
percent,
)}%`}</Typography>
</Box>
</Box>
)
}
BarStats.propTypes = {
percent: PropTypes.number.isRequired,
}