diff --git a/apps/web/src/components/tools/border-settings.tsx b/apps/web/src/components/tools/border-settings.tsx
index 0259f0b3..65ee9ae3 100644
--- a/apps/web/src/components/tools/border-settings.tsx
+++ b/apps/web/src/components/tools/border-settings.tsx
@@ -1,11 +1,12 @@
import { useState } from "react";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Loader2 } from "lucide-react";
+import { Download } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
export function BorderSettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("border");
const [borderWidth, setBorderWidth] = useState(10);
@@ -68,14 +69,24 @@ export function BorderSettings() {
)}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/color-settings.tsx b/apps/web/src/components/tools/color-settings.tsx
index 007955af..170df7d4 100644
--- a/apps/web/src/components/tools/color-settings.tsx
+++ b/apps/web/src/components/tools/color-settings.tsx
@@ -1,7 +1,8 @@
import { useState } from "react";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Loader2 } from "lucide-react";
+import { Download } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
type Tab = "basic" | "channels" | "effects";
type Effect = "none" | "grayscale" | "sepia" | "invert";
@@ -13,7 +14,7 @@ interface ColorSettingsProps {
export function ColorSettings({ toolId }: ColorSettingsProps) {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor(toolId);
const [tab, setTab] = useState(() => {
@@ -199,14 +200,24 @@ export function ColorSettings({ toolId }: ColorSettingsProps) {
)}
{/* Process */}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{/* Download */}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/compress-settings.tsx b/apps/web/src/components/tools/compress-settings.tsx
index 6a616daa..f2f4f31a 100644
--- a/apps/web/src/components/tools/compress-settings.tsx
+++ b/apps/web/src/components/tools/compress-settings.tsx
@@ -1,13 +1,14 @@
import { useState } from "react";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Loader2 } from "lucide-react";
+import { Download } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
type CompressMode = "quality" | "targetSize";
export function CompressSettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("compress");
const [mode, setMode] = useState("quality");
@@ -108,14 +109,24 @@ export function CompressSettings() {
)}
{/* Process */}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{/* Download */}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/convert-settings.tsx b/apps/web/src/components/tools/convert-settings.tsx
index 4c975da6..86c744b0 100644
--- a/apps/web/src/components/tools/convert-settings.tsx
+++ b/apps/web/src/components/tools/convert-settings.tsx
@@ -1,14 +1,15 @@
import { useState } from "react";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Loader2 } from "lucide-react";
+import { Download } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
const OUTPUT_FORMATS = ["jpg", "png", "webp", "avif", "tiff", "gif"] as const;
const LOSSY_FORMATS = new Set(["jpg", "webp", "avif"]);
export function ConvertSettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("convert");
const [format, setFormat] = useState("png");
@@ -102,14 +103,24 @@ export function ConvertSettings() {
)}
{/* Process */}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{/* Download */}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/crop-settings.tsx b/apps/web/src/components/tools/crop-settings.tsx
index 6b0537ff..65a5ff03 100644
--- a/apps/web/src/components/tools/crop-settings.tsx
+++ b/apps/web/src/components/tools/crop-settings.tsx
@@ -1,7 +1,8 @@
import { useState } from "react";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Loader2 } from "lucide-react";
+import { Download } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
const ASPECT_PRESETS = [
{ label: "1:1", w: 1, h: 1 },
@@ -13,7 +14,7 @@ const ASPECT_PRESETS = [
export function CropSettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("crop");
const [left, setLeft] = useState("0");
@@ -125,14 +126,24 @@ export function CropSettings() {
)}
{/* Process */}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{/* Download */}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/gif-tools-settings.tsx b/apps/web/src/components/tools/gif-tools-settings.tsx
index 158c7ba7..a881efd6 100644
--- a/apps/web/src/components/tools/gif-tools-settings.tsx
+++ b/apps/web/src/components/tools/gif-tools-settings.tsx
@@ -1,11 +1,12 @@
import { useState } from "react";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Loader2 } from "lucide-react";
+import { Download } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
export function GifToolsSettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("gif-tools");
const [mode, setMode] = useState<"resize" | "extract">("resize");
@@ -86,14 +87,24 @@ export function GifToolsSettings() {
)}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/replace-color-settings.tsx b/apps/web/src/components/tools/replace-color-settings.tsx
index b15bc9cd..dec3bbb1 100644
--- a/apps/web/src/components/tools/replace-color-settings.tsx
+++ b/apps/web/src/components/tools/replace-color-settings.tsx
@@ -1,11 +1,12 @@
import { useState } from "react";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Loader2 } from "lucide-react";
+import { Download } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
export function ReplaceColorSettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("replace-color");
const [sourceColor, setSourceColor] = useState("#FF0000");
@@ -65,14 +66,24 @@ export function ReplaceColorSettings() {
)}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/resize-settings.tsx b/apps/web/src/components/tools/resize-settings.tsx
index a6fd4f71..e7597099 100644
--- a/apps/web/src/components/tools/resize-settings.tsx
+++ b/apps/web/src/components/tools/resize-settings.tsx
@@ -2,13 +2,14 @@ import { useState } from "react";
import { SOCIAL_MEDIA_PRESETS } from "@stirling-image/shared";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Link, Unlink, Loader2 } from "lucide-react";
+import { Download, Link, Unlink } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
type FitMode = "contain" | "cover" | "fill" | "inside" | "outside";
export function ResizeSettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("resize");
const [mode, setMode] = useState<"pixels" | "percentage">("pixels");
@@ -187,14 +188,24 @@ export function ResizeSettings() {
)}
{/* Process button */}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{/* Download */}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/rotate-settings.tsx b/apps/web/src/components/tools/rotate-settings.tsx
index 1b92112b..1f41f429 100644
--- a/apps/web/src/components/tools/rotate-settings.tsx
+++ b/apps/web/src/components/tools/rotate-settings.tsx
@@ -3,16 +3,16 @@ import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
import {
Download,
- Loader2,
RotateCcw,
RotateCw,
FlipHorizontal,
FlipVertical,
} from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
export function RotateSettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("rotate");
const [angle, setAngle] = useState(0);
@@ -122,14 +122,24 @@ export function RotateSettings() {
)}
{/* Process */}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{/* Download */}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/smart-crop-settings.tsx b/apps/web/src/components/tools/smart-crop-settings.tsx
index 43269cf7..680a3ceb 100644
--- a/apps/web/src/components/tools/smart-crop-settings.tsx
+++ b/apps/web/src/components/tools/smart-crop-settings.tsx
@@ -1,7 +1,8 @@
import { useState } from "react";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Loader2 } from "lucide-react";
+import { Download } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
const ASPECT_PRESETS = [
{ label: "1:1 Square", w: 1080, h: 1080 },
@@ -14,7 +15,7 @@ const ASPECT_PRESETS = [
export function SmartCropSettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("smart-crop");
const [width, setWidth] = useState("1080");
@@ -106,14 +107,24 @@ export function SmartCropSettings() {
)}
{/* Process button */}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{/* Download */}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/strip-metadata-settings.tsx b/apps/web/src/components/tools/strip-metadata-settings.tsx
index d761828b..125c414e 100644
--- a/apps/web/src/components/tools/strip-metadata-settings.tsx
+++ b/apps/web/src/components/tools/strip-metadata-settings.tsx
@@ -1,11 +1,12 @@
import { useState } from "react";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Loader2 } from "lucide-react";
+import { Download } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
export function StripMetadataSettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("strip-metadata");
const [stripAll, setStripAll] = useState(true);
@@ -112,14 +113,24 @@ export function StripMetadataSettings() {
)}
{/* Process */}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{/* Download */}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/text-overlay-settings.tsx b/apps/web/src/components/tools/text-overlay-settings.tsx
index 87da6d68..2bf072dc 100644
--- a/apps/web/src/components/tools/text-overlay-settings.tsx
+++ b/apps/web/src/components/tools/text-overlay-settings.tsx
@@ -1,11 +1,12 @@
import { useState } from "react";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Loader2 } from "lucide-react";
+import { Download } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
export function TextOverlaySettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("text-overlay");
const [text, setText] = useState("Your Text Here");
@@ -86,14 +87,24 @@ export function TextOverlaySettings() {
)}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{downloadUrl && (
diff --git a/apps/web/src/components/tools/watermark-text-settings.tsx b/apps/web/src/components/tools/watermark-text-settings.tsx
index 1ca74248..7311079c 100644
--- a/apps/web/src/components/tools/watermark-text-settings.tsx
+++ b/apps/web/src/components/tools/watermark-text-settings.tsx
@@ -1,13 +1,14 @@
import { useState } from "react";
import { useFileStore } from "@/stores/file-store";
import { useToolProcessor } from "@/hooks/use-tool-processor";
-import { Download, Loader2 } from "lucide-react";
+import { Download } from "lucide-react";
+import { ProgressCard } from "@/components/common/progress-card";
type Position = "center" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "tiled";
export function WatermarkTextSettings() {
const { files } = useFileStore();
- const { processFiles, processing, error, downloadUrl, originalSize, processedSize } =
+ const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } =
useToolProcessor("watermark-text");
const [text, setText] = useState("Sample Watermark");
@@ -90,14 +91,24 @@ export function WatermarkTextSettings() {
)}
-
+ {processing ? (
+
+ ) : (
+
+ )}
{downloadUrl && (