diff --git a/PostFundManagement.ConsoleUI/src/components/layout/AppLayout.tsx b/PostFundManagement.ConsoleUI/src/components/layout/AppLayout.tsx
index ac1b976..54fd012 100644
--- a/PostFundManagement.ConsoleUI/src/components/layout/AppLayout.tsx
+++ b/PostFundManagement.ConsoleUI/src/components/layout/AppLayout.tsx
@@ -23,6 +23,7 @@ import {
import { useAuth } from '../../auth/AuthProvider';
import { BrandLogo } from '../ui/BrandLogo';
import { HelpTooltip } from '../ui/HelpTooltip';
+import { ErrorBoundary } from '../ui/ErrorBoundary';
import { useQuery } from '@tanstack/react-query';
import { getUsers } from '../../services/api';
import { getUserEmail, registerUserEmail } from '../../lib/formatters';
@@ -395,7 +396,9 @@ export const AppLayout: React.FC = () => {
{
+ declare props: Props;
+ declare state: State;
+
+ constructor(props: Props) {
+ super(props);
+ this.state = {
+ hasError: false,
+ error: null,
+ };
+ }
+
+ public static getDerivedStateFromError(error: Error): State {
+ return { hasError: true, error };
+ }
+
+ public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
+ console.error('[PFM Error Boundary Caught]', error, errorInfo);
+ }
+
+ public handleReset = () => {
+ (this as any).setState({ hasError: false, error: null });
+ };
+
+ public render() {
+ if (this.state.hasError) {
+ return (
+
+
+
+
+ {this.props.fallbackTitle || 'Display Module Encountered an Issue'}
+
+
+ An unexpected display error occurred while rendering this view. You can reload the view or return to the executive dashboard.
+
+
+
+
+ );
+ }
+
+ return this.props.children;
+ }
+}
diff --git a/PostFundManagement.ConsoleUI/src/components/ui/StatusBadge.tsx b/PostFundManagement.ConsoleUI/src/components/ui/StatusBadge.tsx
new file mode 100644
index 0000000..ea872a3
--- /dev/null
+++ b/PostFundManagement.ConsoleUI/src/components/ui/StatusBadge.tsx
@@ -0,0 +1,31 @@
+import React from 'react';
+import { ApprovalStatus, Priority, ActivityStatus } from '../../types';
+import { getApprovalStatusBadge, getPriorityBadge, getActivityStatusBadge } from '../../lib/formatters';
+
+export const ApprovalStatusBadge: React.FC<{ status: ApprovalStatus | number | null | undefined }> = ({ status }) => {
+ const badge = getApprovalStatusBadge(status ?? ApprovalStatus.Pending);
+ return (
+
+ {badge.dot && }
+ {badge.label}
+
+ );
+};
+
+export const PriorityBadge: React.FC<{ priority: Priority | number | null | undefined }> = ({ priority }) => {
+ const badge = getPriorityBadge(priority ?? Priority.Medium);
+ return (
+
+ {badge.label}
+
+ );
+};
+
+export const ActivityStatusBadge: React.FC<{ status: ActivityStatus | number | string | boolean | null | undefined }> = ({ status }) => {
+ const badge = getActivityStatusBadge(status);
+ return (
+
+ {badge.label}
+
+ );
+};
diff --git a/PostFundManagement.ConsoleUI/src/pages/BeneficiariesPage.tsx b/PostFundManagement.ConsoleUI/src/pages/BeneficiariesPage.tsx
index 29d877a..eb3abea 100644
--- a/PostFundManagement.ConsoleUI/src/pages/BeneficiariesPage.tsx
+++ b/PostFundManagement.ConsoleUI/src/pages/BeneficiariesPage.tsx
@@ -38,6 +38,7 @@ import { HelpTooltip } from '../components/ui/HelpTooltip';
import { ExportButton } from '../components/ui/ExportButton';
import { ExportColumn } from '../utils/exportUtils';
import { useTableSort, SortableTh } from '../utils/tableSort';
+import { ApprovalStatusBadge } from '../components/ui/StatusBadge';
import { Beneficiary, ComplianceItem, Outcome, ApprovalStatus } from '../types';
import { getApprovalStatusBadge, formatDate, APPROVAL_STATUS_OPTIONS } from '../lib/formatters';
@@ -727,7 +728,9 @@ export const BeneficiariesPage: React.FC = () => {
{c.requirements || 'None'}
|
- {getApprovalStatusBadge(c.status)} |
+
+
+ |
{formatDate(c.createdAt)} |
|
- {getPriorityBadge(iss.priority)} |
+
+
+ |
@@ -678,7 +681,7 @@ export const ChangeManagementPage: React.FC = () => {
|