feat(web): add Stirling-PDF-style file preview, review panel, and tool chaining UX

After upload: dropzone replaced by image viewer with zoom controls.
After processing: review panel shows result preview, file info, download,
undo button, and suggested next tools for chaining.
This commit is contained in:
Siddharth Kumar Sah
2026-03-22 10:47:46 +08:00
parent 80bb0e29a0
commit ab0b0344b9
6 changed files with 528 additions and 53 deletions
+15
View File
@@ -0,0 +1,15 @@
export function triggerDownload(url: string, filename: string) {
const a = document.createElement("a");
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}
export function formatFileSize(bytes: number): string {
if (bytes < 1024 * 1024) {
return `${(bytes / 1024).toFixed(0)} KB`;
}
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
}