+ {/* Drag-and-drop zone */}
+
+ {/* Icon */}
+
+
+ {/* Main text */}
+
+ {isUploading ? (
+ Uploading...
+ ) : (
+ Drag files here or click to browse
+ )}
+
+
+ {/* Hint text */}
+
+ Supported: Images, PDFs, Documents (max 10MB)
+
+
+ {/* Browse button */}
+ {!isUploading && (
+
+ )}
+
+ {/* Hidden file input */}
+
+
+
+ {/* Progress bar */}
+ {isUploading && uploadProgress !== undefined && (
+
+
+
+ Uploading...
+
+
+ {uploadProgress}%
+
+
+
+
+ )}
+
+ );
+}
diff --git a/src/pages/Secrets/SecretDetail.test.tsx b/src/pages/Secrets/SecretDetail.test.tsx
index da63b21..4e64e41 100644
--- a/src/pages/Secrets/SecretDetail.test.tsx
+++ b/src/pages/Secrets/SecretDetail.test.tsx
@@ -5,6 +5,8 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { Route, Routes, MemoryRouter } from "react-router";
+import { I18nProvider } from "@lingui/react";
+import { i18n } from "@lingui/core";
import { SecretDetail } from "./SecretDetail";
import * as secretApi from "../../services/secretApi";
import type { SecretDetail as SecretDetailType } from "../../services/secretApi";
@@ -16,6 +18,9 @@ vi.mock("../../services/secretApi", async (importOriginal) => {
return {
...actual,
getSecretById: vi.fn(),
+ getSecretMasterKey: vi.fn(),
+ downloadAndDecryptAttachment: vi.fn(),
+ deleteAttachment: vi.fn(),
};
});
@@ -68,11 +73,13 @@ describe("SecretDetail", () => {
// Helper to render with router
const renderWithRouter = (secretId: string) => {
return render(
-