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>
This commit is contained in:
2026-03-16 18:24:25 +05:30
parent 530dfa1aa4
commit 26c352e2cc
9 changed files with 208 additions and 48 deletions

View File

@@ -20,7 +20,7 @@ const features = [
},
];
type RoleTab = 'executive' | 'admin';
type RoleTab = 'executive' | 'cc-agent' | 'admin';
export const LoginPage = () => {
const { login, setRole } = useAuth();
@@ -124,30 +124,25 @@ export const LoginPage = () => {
<div
className="mt-8 flex items-center gap-1 rounded-xl p-1 bg-secondary"
>
<button
type="button"
onClick={() => handleTabChange('executive')}
className={[
'flex-1 rounded-lg px-3 py-2 text-sm font-semibold transition duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]',
activeTab === 'executive'
? 'bg-primary text-brand-secondary shadow-sm'
: 'text-tertiary hover:text-secondary',
].join(' ')}
>
Marketing Executive
</button>
<button
type="button"
onClick={() => handleTabChange('admin')}
className={[
'flex-1 rounded-lg px-3 py-2 text-sm font-semibold transition duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]',
activeTab === 'admin'
? 'bg-primary text-brand-secondary shadow-sm'
: 'text-tertiary hover:text-secondary',
].join(' ')}
>
Admin
</button>
{([
{ key: 'executive' as const, label: 'Marketing Executive' },
{ key: 'cc-agent' as const, label: 'Call Center' },
{ key: 'admin' as const, label: 'Admin' },
]).map((tab) => (
<button
key={tab.key}
type="button"
onClick={() => handleTabChange(tab.key)}
className={[
'flex-1 rounded-lg px-3 py-2 text-sm font-semibold transition duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]',
activeTab === tab.key
? 'bg-primary text-brand-secondary shadow-sm'
: 'text-tertiary hover:text-secondary',
].join(' ')}
>
{tab.label}
</button>
))}
</div>
{/* Google sign-in */}