fix: wire role-based views — sidebar auth, user display, table tabs, card actions

- Sidebar: use useAuth() for isAdmin and pass auth user to NavAccountCard
- NavAccountCard: fix bug where items prop was ignored (used placeholderAccounts)
- TopBar: replace hardcoded "SM" initials with user.initials from auth
- All Leads: add "My Leads" tab filtering by assignedAgent matching user
- Lead Card: add role-aware action buttons (Call/Disposition for assigned leads)
- Lead Workspace: pass onLogCall/onUpdateStatus handlers to LeadCard

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-16 16:15:08 +05:30
parent 8b796bf916
commit d98da9a1ea
6 changed files with 56 additions and 7 deletions

View File

@@ -167,7 +167,7 @@ export const NavAccountCard = ({
const triggerRef = useRef<HTMLDivElement>(null);
const isDesktop = useBreakpoint("lg");
const selectedAccount = placeholderAccounts.find((account) => account.id === selectedAccountId);
const selectedAccount = items.find((account) => account.id === selectedAccountId);
if (!selectedAccount) {
console.warn(`Account with ID ${selectedAccountId} not found in <NavAccountCard />`);