Files
helix-engage/src/components/layout/role-router.tsx
saridsa2 26c352e2cc feat: 3-role auth, role-based routing, role-specific sidebar navigation
Add cc-agent role alongside executive and admin. Login page now has 3 tabs
(Marketing Executive, Call Center, Admin). RoleRouter renders the appropriate
home page per role. Sidebar shows completely different nav items per role with
role subtitle. Placeholder pages added for Team Dashboard, Call Desk, Call
History, and Follow-ups.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 18:24:25 +05:30

18 lines
510 B
TypeScript

import { useAuth } from '@/providers/auth-provider';
import { LeadWorkspacePage } from '@/pages/lead-workspace';
import { TeamDashboardPage } from '@/pages/team-dashboard';
import { CallDeskPage } from '@/pages/call-desk';
export const RoleRouter = () => {
const { user } = useAuth();
switch (user.role) {
case 'admin':
return <TeamDashboardPage />;
case 'cc-agent':
return <CallDeskPage />;
default:
return <LeadWorkspacePage />;
}
};