{/* Auth Callback - Must be before other routes */}
}
/>
{/* Dashboard */}
}
/>
}
/>
{/* Open Requests */}
}
/>
{/* Closed Requests */}
}
/>
{/* Shared Summaries */}
}
/>
{/* Shared Summary Detail */}
}
/>
{/* My Requests */}
}
/>
{/* Requests - Separate screens for Admin and Regular Users */}
}
/>
{/* Approver Performance - Detailed Performance Analysis */}
}
/>
{/* Request Detail - requestId will be read from URL params */}
}
/>
{/* Work Notes - Dedicated Full-Screen Page */}
}
/>
{/* New Request (Custom) */}
}
/>
{/* Edit Draft Request */}
}
/>
{/* Claim Management Wizard */}
}
/>
{/* Profile */}
}
/>
{/* Settings */}
}
/>
{/* Notifications */}
}
/>
{/* Detailed Reports */}
}
/>
{/* Admin Control Panel */}
}
/>
{/* Manager Selection Modal */}
{
setManagerModalOpen(false);
setManagerModalData(null);
}}
onSelect={async (managerEmail: string) => {
if (managerModalData?.pendingClaimData) {
// Retry creating claim request with selected manager
// The pendingClaimData contains all the form data from the wizard
// This preserves the entire submission state while waiting for manager selection
await handleClaimManagementSubmit(managerModalData.pendingClaimData, managerEmail);
}
}}
managers={managerModalData?.managers}
errorType={managerModalData?.errorType || 'NO_MANAGER_FOUND'}
message={managerModalData?.message}
isLoading={false} // Will be set to true during retry if needed
/>
{/* Approval Action Modal */}
{approvalAction && (
)}
);
}
// Main App Component with Router
interface MainAppProps {
onLogout?: () => void;
}
export default function App(props?: MainAppProps) {
const { onLogout } = props || {};
return (