- window.location.reload()} />
+ window.location.reload()} />
@@ -139,8 +147,18 @@ export default function App() {
// Helper to determine page title based on path
const getPageTitle = (pathname: string) => {
if (pathname.startsWith('/applications/') && pathname.length > 14) return 'Application Details';
- if (pathname.includes('/resignation/') && pathname.length > 13) return 'Resignation Details';
- // ... Add more dynamic title logic as needed
+ if (pathname.startsWith('/resignation/') && !pathname.startsWith('/dealer-resignation')) return 'Resignation Details';
+ if (pathname.startsWith('/dealer-resignation/')) return 'Resignation Request Details';
+ if (pathname.startsWith('/termination/')) return 'Termination Details';
+ if (pathname.startsWith('/fnf/')) return 'F&F Request Details';
+ if (pathname.startsWith('/constitutional-change/')) return 'Constitutional Change Details';
+ if (pathname.startsWith('/relocation-requests/')) return 'Relocation Request Details';
+ if (pathname.startsWith('/finance-onboarding/')) return 'Payment Details';
+ if (pathname.startsWith('/finance-audit/')) return 'Finance Audit';
+ if (pathname.startsWith('/finance-fnf/')) return 'F&F Settlement Details';
+ if (pathname.startsWith('/fdd-details/')) return 'FDD Audit Workspace';
+ if (pathname.startsWith('/questionnaire-builder/')) return 'Questionnaire Builder';
+ if (pathname.startsWith('/worknotes/')) return 'Work Notes';
const titles: Record = {
'/dashboard': 'Dashboard',
'/applications': 'Dealership Requests',
@@ -166,11 +184,155 @@ export default function App() {
'/approval-policies': 'Approval Policies',
'/fdd-dashboard': 'FDD Dashboard',
'/fdd-details': 'Audit Workspace',
+ '/questions': 'Questionnaires',
+ '/questionnaires': 'Questionnaire Templates',
+ '/interview-configs': 'Interview Configuration',
+ '/system-logs': 'System Logs',
+ '/sla-configurations': 'SLA Matrix',
'/notifications': 'Notifications',
};
return titles[pathname] || 'Dashboard';
};
+ /** Short context line under the main header title — varies by route (and sometimes role). */
+ const getPageSubtitle = (pathname: string, role: string) => {
+ const rl = (role || '').toLowerCase();
+ const isDealerRole = rl === 'dealer' || rl.includes('dealer');
+ const isFinanceRole = rl.includes('finance');
+
+ if (pathname.startsWith('/worknotes/')) {
+ return 'Collaborative notes and clarifications linked to this onboarding or offboarding record.';
+ }
+ if (pathname.startsWith('/applications/') && pathname !== '/applications') {
+ return 'Review stages, documents, interviews, and decisions for this single dealership onboarding application.';
+ }
+ if (pathname === '/applications') {
+ return 'Search, filter, and open dealership applications your role can work on.';
+ }
+ if (pathname === '/all-applications') {
+ return 'Cross-team view of every dealership application in the pipeline.';
+ }
+ if (pathname === '/opportunity-requests') {
+ return 'Applications tied to an opportunity location for DD prioritisation.';
+ }
+ if (pathname === '/non-opportunities') {
+ return 'Applications without a mapped opportunity; track for future reference or follow-up.';
+ }
+ if (pathname === '/dashboard') {
+ if (isDealerRole) {
+ return 'Your home for outlet actions: constitutional change (how your business is legally registered), relocation, and resignation requests.';
+ }
+ if (isFinanceRole) {
+ return 'Payment verification, finance audits, and F&F settlement work for dealership accounts.';
+ }
+ return 'Operational snapshot for dealership onboarding: workloads, alerts, and shortcuts for your role.';
+ }
+ if (pathname.startsWith('/dealer-resignation/')) {
+ return 'Read-only summary of the resignation you submitted for this outlet.';
+ }
+ if (pathname === '/dealer-resignation') {
+ return 'Start a new outlet resignation or open a request you already submitted.';
+ }
+ if (pathname === '/dealer-constitutional') {
+ return 'Constitutional change updates your outlet’s registered legal structure (for example sole proprietorship to private limited). Submit one request per outlet; Royal Enfield teams review documents and approve before records change.';
+ }
+ if (pathname === '/dealer-relocation') {
+ return 'Request a move of your dealership to a new address or territory, and track requests in progress.';
+ }
+ if (pathname.startsWith('/constitutional-change/')) {
+ return 'Review evidence, comments, and workflow for this constitutional change case.';
+ }
+ if (pathname === '/constitutional-change') {
+ return 'Process dealer requests to change registered legal constitution, supporting documents, and approvals.';
+ }
+ if (pathname.startsWith('/relocation-requests/')) {
+ return 'Assess feasibility, documents, and approvals for this relocation request.';
+ }
+ if (pathname === '/relocation-requests') {
+ return 'Manage dealer relocation proposals: new sites, handovers, and compliance checks.';
+ }
+ if (pathname.startsWith('/resignation/') && !pathname.startsWith('/dealer-resignation')) {
+ return 'HR workflow: clearances, handovers, and settlement steps for this resignation.';
+ }
+ if (pathname === '/resignation') {
+ return 'Queue of dealership resignation cases across your authorised outlets.';
+ }
+ if (pathname.startsWith('/termination/')) {
+ return 'Contractual exit details, evidence, and approvals for this termination case.';
+ }
+ if (pathname === '/termination') {
+ return 'Monitor dealership terminations, disputes, and mandated approvals.';
+ }
+ if (pathname.startsWith('/fnf/')) {
+ return 'Line items, deductions, and payout status for this full & final settlement.';
+ }
+ if (pathname === '/fnf') {
+ return 'Track F&F batches from clearance through finance payout.';
+ }
+ if (pathname.startsWith('/finance-onboarding/')) {
+ return 'Payment schedule, proofs, and audit notes for this onboarding application.';
+ }
+ if (pathname === '/finance-onboarding') {
+ return 'Validate security deposits, first fills, and related onboarding payments.';
+ }
+ if (pathname.startsWith('/finance-audit/')) {
+ return 'Finance audit trail and checklist for this application.';
+ }
+ if (pathname.startsWith('/finance-fnf/')) {
+ return 'Settlement calculations and release steps for this F&F record.';
+ }
+ if (pathname === '/finance-fnf') {
+ return 'Finance queue for F&F approvals and disbursements.';
+ }
+ if (pathname.startsWith('/fdd-details/')) {
+ return 'Field Development Director audit workspace for this application.';
+ }
+ if (pathname === '/fdd-dashboard') {
+ return 'FDD workload: audits due, flags raised, and follow-up actions.';
+ }
+ if (pathname.startsWith('/questionnaire-builder/') || pathname === '/questionnaire-builder') {
+ return 'Author and publish questionnaire versions used in dealership assessments.';
+ }
+ if (pathname === '/questionnaires' || pathname === '/questions') {
+ return 'List of published questionnaire templates and versions.';
+ }
+ if (pathname === '/master') {
+ return 'Hierarchy, geography, templates, and reference data shared across onboarding.';
+ }
+ if (pathname === '/users') {
+ return 'Create and maintain internal users, roles, and access for this portal.';
+ }
+ if (pathname === '/approval-policies') {
+ return 'Configure who must approve each onboarding stage or document type.';
+ }
+ if (pathname === '/sla-configurations') {
+ return 'Define turnaround targets and escalations for onboarding milestones.';
+ }
+ if (pathname === '/interview-configs') {
+ return 'Set up interview templates, panels, and scoring used during selection.';
+ }
+ if (pathname === '/system-logs') {
+ return 'Immutable record of configuration and administrative actions for compliance.';
+ }
+ if (pathname === '/notifications') {
+ return 'System and workflow alerts for your account.';
+ }
+ if (pathname === '/tasks') {
+ return 'Tasks assigned to you (placeholder module).';
+ }
+ if (pathname === '/reports') {
+ return 'Analytics and exports for onboarding performance (placeholder module).';
+ }
+ if (pathname === '/settings') {
+ return 'Profile, notifications, and security preferences for your account.';
+ }
+
+ const title = getPageTitle(pathname);
+ return title === 'Dashboard'
+ ? 'Operational snapshot for dealership onboarding: workloads, alerts, and shortcuts for your role.'
+ : `You are viewing: ${title}.`;
+ };
+
if (loading) {
return (