import * as React from "react"; import { Box, Typography, Paper, LinearProgress, Divider, linearProgressClasses } from "@mui/material"; import { useTheme, alpha } from "@mui/material/styles"; import { ProgressCardProps } from "./ProgressCard.models"; interface ViewProps extends ProgressCardProps { percentage: number; formattedProgress: string; formattedTotal: string; } export default function ProgressCardView({ header, colorTheme = "info", percentage, formattedProgress, formattedTotal, compact = false, }: ViewProps) { const theme = useTheme(); const isDark = theme.palette.mode === "dark"; return ( { const baseColor = theme.palette[colorTheme]?.main || theme.palette.primary.main; const lightColor = theme.palette[colorTheme]?.light || theme.palette.primary.light; return isDark ? `linear-gradient(135deg, ${alpha(baseColor, 0.9)} 0%, ${alpha(baseColor, 0.3)} 100%)` : `linear-gradient(135deg, ${baseColor} 0%, ${lightColor} 100%)`; }, color: "#fff", display: "flex", flexDirection: "column", alignItems: compact ? "flex-start" : "center", justifyContent: "center", position: "relative", overflow: "hidden", border: isDark ? "1px solid rgba(255,255,255,0.1)" : "none", boxShadow: (theme) => `0 ${compact ? 6 : 12}px ${compact ? 12 : 24}px -10px ${ isDark ? "rgba(0,0,0,0.5)" : theme.palette[colorTheme]?.main || theme.palette.primary.main }`, }} > {header} {formattedProgress} of {formattedTotal} ); }