diff --git a/src/app/(modules)/rgi-test/page.tsx b/src/app/(modules)/rgi-test/page.tsx index a5cb90c..a215077 100644 --- a/src/app/(modules)/rgi-test/page.tsx +++ b/src/app/(modules)/rgi-test/page.tsx @@ -260,22 +260,12 @@ function IssuedDocsPanel({ ); } - const isLocked = dueDate > Date.now(); - return (
-
-

- {docs.length} document{docs.length > 1 ? "e" : ""} eliberat - {docs.length > 1 ? "e" : ""} -

- {isLocked && ( - - - Disponibile de la {fmtTs(dueDate)} - - )} -
+

+ {docs.length} document{docs.length > 1 ? "e" : ""} eliberat + {docs.length > 1 ? "e" : ""}: +

{docs.map((doc, i) => (
-
- {isLocked ? ( - - - {fmtTs(dueDate)} - - ) : ( - - )} -
+ ))} @@ -403,16 +384,14 @@ export default function RgiTestPage() { setLoading(false); }, [workspaceId, orgUnitId, year]); - const [filterMode, setFilterMode] = useState<"all" | "ready" | "pending">("ready"); + const [filterMode, setFilterMode] = useState<"all" | "solved" | "confirmed">("solved"); // Client-side filter const filtered = useMemo(() => { if (filterMode === "all") return applications; - const now = Date.now(); return applications.filter((a) => { - if (a.hasSolution !== 1) return false; - if (filterMode === "ready") return a.dueDate <= now; // termen trecut = descarcabil - if (filterMode === "pending") return a.dueDate > now; // termen viitor = blocat + if (filterMode === "solved") return a.hasSolution === 1; + if (filterMode === "confirmed") return a.stateCode === "CONFIRMED"; return true; }); }, [applications, filterMode]); @@ -498,8 +477,8 @@ export default function RgiTestPage() {
{([ - { id: "ready" as const, label: "Descarcabile acum", desc: "solutionate + termen trecut" }, - { id: "pending" as const, label: "In asteptare", desc: "solutionate + termen viitor (blocate)" }, + { id: "solved" as const, label: "Solutionate", desc: "lucrari cu solutie" }, + { id: "confirmed" as const, label: "Confirmate", desc: "solutie confirmata" }, { id: "all" as const, label: "Toate", desc: "" }, ]).map((opt) => (