Files
Checkmate/client/src/Pages/StatusPage/Create/Components/Progress/index.jsx
T

38 lines
872 B
React
Raw Normal View History

2025-02-02 21:26:48 -08:00
import { Button, Box } from "@mui/material";
2025-09-27 14:54:55 -07:00
import ProgressUpload from "@/Components/v1/ProgressBars/index.jsx";
2025-02-02 21:26:48 -08:00
import ImageIcon from "@mui/icons-material/Image";
2025-03-17 01:16:42 +05:30
import { useTranslation } from "react-i18next";
2026-01-12 23:57:39 +00:00
import { formatBytes } from "../../../../../Utils/fileUtils.js";
2025-02-02 21:26:48 -08:00
const Progress = ({ isLoading, progressValue, logo, logoType, removeLogo, errors }) => {
2025-03-17 01:16:42 +05:30
const { t } = useTranslation();
2025-02-02 21:26:48 -08:00
if (isLoading) {
return (
<ProgressUpload
icon={<ImageIcon />}
label={logo?.name}
size={formatBytes(logo?.size)}
progress={progressValue}
onClick={removeLogo}
/>
);
}
if (logo && logoType) {
return (
<Box
width="fit-content"
alignSelf="center"
>
<Button
variant="contained"
color="secondary"
onClick={removeLogo}
>
2025-03-17 01:16:42 +05:30
{t("removeLogo")}
2025-02-02 21:26:48 -08:00
</Button>
</Box>
);
}
};
export default Progress;