import React, { useEffect } from "react"; import Spinner from "../../icons/Spinner"; function ProgressBar({ progress, doubleUpscaylCounter, stopHandler, batchMode, }: { progress: string; doubleUpscaylCounter: number; stopHandler: () => void; batchMode: boolean; }) { const [batchProgress, setBatchProgress] = React.useState(0); useEffect(() => { const progressString = progress.trim().replace(/\n/g, ""); // Remove trailing and leading spaces if (progressString.includes("Successful")) { setBatchProgress((prev) => prev + 1); } }, [progress]); return (
Upscayl Icon

{batchMode && "Batch Upscale In Progress: " + batchProgress} {!batchMode && (doubleUpscaylCounter > 0 ? `${progress}\nPass ${doubleUpscaylCounter}` : `${progress}`)}

Doing the Upscayl magic...

{batchMode && (

Info: The images will be converted and scaled after the upscaling process.

)}
); } export default ProgressBar;