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

43 lines
908 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";
import Icon from "@/Components/v1/Icon";
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
2026-01-15 23:39:26 -05:00
icon={
<Icon
name="Image"
size={20}
/>
}
2025-02-02 21:26:48 -08:00
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;