Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | 3x 284x 253x 169x 85x 85x 85x 85x 85x 70x 15x 15x 15x | "use client";
import type { ComplianceLevel, MatrixRow } from "./types";
export function rowKey(
row: Pick<MatrixRow, "applicationId" | "consumerId">,
): string {
return row.applicationId ?? row.consumerId;
}
export function isUndecided(row: MatrixRow): boolean {
return (
row.hasApplication &&
!row.hasApproval &&
!["APPROVED", "REJECTED", "REVOKED"].includes(
(row.applicationStatus ?? "").toUpperCase(),
)
);
}
export function shortDate(iso: string | null | undefined): string {
return iso ? iso.slice(0, 10) : "";
}
export function complianceLevel(row: MatrixRow): ComplianceLevel {
// HDAB authorities review others — they don't submit applications
Iif (row.consumerType === "HDAB" && !row.hasApplication) return "governance";
Iif (row.approvalStatus === "REVOKED" || row.applicationStatus === "REVOKED") {
return "revoked";
}
Iif (row.approvalStatus === "REJECTED" || row.applicationStatus === "REJECTED")
return "rejected";
Iif (row.applicationStatus === "UNDER_REVIEW") return "review";
if (row.applicationStatus === "PENDING") return "pending";
if (row.hasApproval && row.datasetId && row.hasContract) return "full";
Iif (row.hasApproval && row.datasetId) return "approved";
Iif (row.hasApplication) return "pending";
return "none";
}
|