import { Box, LinearProgress, Typography } from '@mui/material';

type LinearWithLabelProps = {
  value: number;
};
function LinearWithLabel({ value, ...others }: LinearWithLabelProps) {
  return (
    <Box sx={{ display: 'flex', alignItems: 'center' }}>
      <Box sx={{ width: '100%', mr: 1 }}>
        <LinearProgress variant="determinate" value={value} {...others} />
      </Box>
      <Box sx={{ minWidth: 35 }}>
        <Typography variant="body2" color="text.secondary">{`${Math.round(value)}%`}</Typography>
      </Box>
    </Box>
  );
}

export { LinearWithLabel };
export type { LinearWithLabelProps };
