FPSMS-frontend
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

50 linhas
1.0 KiB

  1. "use client";
  2. import { Box, LinearProgress, Typography } from "@mui/material";
  3. import React from "react";
  4. interface LinearProgressWithLabelProps {
  5. completed: number;
  6. total: number;
  7. label: string;
  8. }
  9. const LinearProgressWithLabel: React.FC<LinearProgressWithLabelProps> = ({
  10. completed,
  11. total,
  12. label,
  13. }) => {
  14. const progress = total > 0 ? (completed / total) * 100 : 0;
  15. return (
  16. <Box sx={{ width: "100%", mb: 2 }}>
  17. <Box sx={{ display: "flex", alignItems: "center", mb: 1 }}>
  18. <Box sx={{ width: "100%", mr: 1 }}>
  19. <LinearProgress
  20. variant="determinate"
  21. value={progress}
  22. sx={{
  23. height: 30,
  24. borderRadius: 5,
  25. }}
  26. />
  27. </Box>
  28. <Box sx={{ minWidth: 80 }}>
  29. <Typography variant="body2" color="text.secondary">
  30. <strong>
  31. {label}: {completed}/{total}
  32. </strong>
  33. </Typography>
  34. </Box>
  35. </Box>
  36. </Box>
  37. );
  38. };
  39. export default LinearProgressWithLabel;