+ {errorMsg && (
+
+ )}
+
+ {canUpload && (
+
{
+ e.preventDefault();
+ setDragActive(true);
+ }}
+ onDragLeave={() => setDragActive(false)}
+ onDrop={(e) => {
+ e.preventDefault();
+ setDragActive(false);
+ handleFiles(e.dataTransfer.files);
+ }}
+ className={`border-2 border-dashed rounded-lg p-5 text-center transition-colors ${
+ dragActive
+ ? "border-[#1e3a8a] bg-blue-50/50"
+ : "border-gray-300 bg-gray-50/50 hover:border-gray-400"
+ }`}
+ >
+
{
+ handleFiles(e.target.files);
+ e.target.value = "";
+ }}
+ />
+
+
+ Drag and drop a file here, or{" "}
+
+
+
+ Allowed: JPG, PNG, PDF • Max size: 10 MB
+
+ {uploadMutation.isPending && (
+
Uploading...
+ )}
+
+ )}
+
+ {isLoading ? (
+
+ {[1, 2].map((i) => (
+
+ ))}
+
+ ) : items.length === 0 ? (
+
+ No attachments uploaded yet.
+
+ ) : (
+
+ {items.map((att) => {
+ const isPdf = att.mime_type === "application/pdf";
+ return (
+
+
+
+ {isPdf ? : }
+
+
+
+ {att.original_name}
+
+
+ {formatBytes(att.size_bytes)}
+ {att.uploaded_by_name ? ` • Uploaded by ${att.uploaded_by_name}` : ""}
+ {" • "}
+ {formatDateTime(att.uploaded_at)}
+
+
+
+
+
+
+
+ {canDelete && (
+ confirmDeleteId === att.id ? (
+
+
+
+
+ ) : (
+
+ )
+ )}
+
+
+ );
+ })}
+
+ )}
+
+ );
+}
diff --git a/frontend/src/components/StatusBadge.tsx b/frontend/src/components/StatusBadge.tsx
new file mode 100644
index 0000000..35aa98d
--- /dev/null
+++ b/frontend/src/components/StatusBadge.tsx
@@ -0,0 +1,201 @@
+import {
+ CheckCircle2,
+ Wrench,
+ AlertTriangle,
+ Ban,
+ Clock,
+ ShieldAlert,
+ MinusCircle,
+} from "lucide-react";
+import { cn } from "@/lib/utils";
+import type {
+ AssetStatus,
+ AssetCriticality,
+ CoverageStatus,
+ AlertSeverity,
+ CalibrationStatus,
+} from "@/api/assets";
+
+export function AssetStatusBadge({
+ status,
+ className,
+}: {
+ status: AssetStatus | string;
+ className?: string;
+}) {
+ const map: Record