diff --git a/apps/edr-freight-web/portal/src/components/onboarding/OnboardingResumeBanner.tsx b/apps/edr-freight-web/portal/src/components/onboarding/OnboardingResumeBanner.tsx index 21d4d0746..a7cf1a2aa 100644 --- a/apps/edr-freight-web/portal/src/components/onboarding/OnboardingResumeBanner.tsx +++ b/apps/edr-freight-web/portal/src/components/onboarding/OnboardingResumeBanner.tsx @@ -1,6 +1,6 @@ import { useQuery } from "@tanstack/react-query"; import { Link } from "react-router-dom"; -import { AlertTriangle, ArrowRight, Clock } from "lucide-react"; +import { AlertTriangle, ArrowRight, CheckCircle2, Clock } from "lucide-react"; import { api } from "@/services/api"; import useAuth from "@/hooks/useAuth"; import type { OnboardingRequirements } from "@/services/companies.service"; @@ -157,11 +157,34 @@ export default function OnboardingResumeBanner({ * Self-hides when there's nothing outstanding. */ export function AccountReviewBanner() { - const { company, reviewStatus, reviewNote } = useAuth(); + const { company, companyStatus, reviewStatus, reviewNote } = useAuth(); const profiles = company?.company?.companyProfiles ?? []; const pending = profiles.filter((p) => p.status === "pending"); const approved = profiles.filter((p) => p.status === "active"); + // 0. Account suspended/blacklisted — the hardest lock, takes priority over + // everything else since nothing below matters if the account is shut down. + if (companyStatus === "suspended" || companyStatus === "blacklisted") { + return ( +
+
+ + + + + + Your account has been suspended + + + Contact EDR support to resolve this before you can continue + working. + + +
+
+ ); + } + // 1. Profile-edit review pending — the account-wide lock. if (reviewStatus === "pending") { return ( @@ -216,8 +239,45 @@ export function AccountReviewBanner() { ); } - // 3. Per-operational-profile approval (existing behaviour). - if (profiles.length === 0 || pending.length === 0) return null; + // 3. Company approved and awaiting its first operational profile — nothing + // profile-specific to report yet, but the account itself is pending. + if (profiles.length === 0) { + if (companyStatus === "pending") { + return ( +
+
+ + + + + Your account is pending approval + +
+
+ ); + } + return null; + } + + // 4. Per-operational-profile approval (existing behaviour). + if (pending.length === 0) { + // Nothing outstanding — a quiet confirmation that the account is live. + if (companyStatus === "active") { + return ( +
+
+ + + + + Your account is approved + +
+
+ ); + } + return null; + } const pendingLabel = pending .map((p) => p.type.replace(/_/g, " "))