feat: wire real auth — login returns user profile with role from platform, remove mock users and role selector tabs

This commit is contained in:
2026-03-18 10:42:54 +05:30
parent 832fa31597
commit 66ad398b81
4 changed files with 82 additions and 72 deletions

View File

@@ -14,6 +14,7 @@ import {
import { Button } from '@/components/base/buttons/button';
import { TextArea } from '@/components/base/textarea/textarea';
import { useSip } from '@/providers/sip-provider';
import { useAuth } from '@/providers/auth-provider';
import { cx } from '@/utils/cx';
import type { CallDisposition } from '@/types/entities';
@@ -97,6 +98,7 @@ export const CallWidget = () => {
toggleMute,
toggleHold,
} = useSip();
const { user } = useAuth();
const [disposition, setDisposition] = useState<CallDisposition | null>(null);
const [notes, setNotes] = useState('');
@@ -180,7 +182,7 @@ export const CallWidget = () => {
data: {
callDirection: 'INBOUND',
callStatus: 'COMPLETED',
agentName: 'Rekha S.',
agentName: user.name,
startedAt: callStartTimeRef.current,
endedAt: new Date().toISOString(),
durationSeconds: callDuration,
@@ -228,7 +230,7 @@ export const CallWidget = () => {
activityType: 'CALL_RECEIVED',
summary: `Inbound call — ${disposition.replace(/_/g, ' ')}`,
occurredAt: new Date().toISOString(),
performedBy: 'Rekha S.',
performedBy: user.name,
channel: 'PHONE',
durationSeconds: callDuration,
leadId: matchedLead.id,