diff --git a/src/pages/call-recordings.tsx b/src/pages/call-recordings.tsx index d0e3916..2846233 100644 --- a/src/pages/call-recordings.tsx +++ b/src/pages/call-recordings.tsx @@ -26,6 +26,7 @@ type RecordingRecord = { callStatus: string | null; callerNumber: { primaryPhoneNumber: string } | null; agentName: string | null; + agent: { id: string; name: string; ozonetelAgentId: string } | null; startedAt: string | null; durationSec: number | null; disposition: string | null; @@ -35,7 +36,8 @@ type RecordingRecord = { const QUERY = `{ calls(first: 200, orderBy: [{ startedAt: DescNullsLast }]) { edges { node { id createdAt direction callStatus callerNumber { primaryPhoneNumber } - agentName startedAt durationSec disposition sla + agentName agent { id name ozonetelAgentId } + startedAt durationSec disposition sla recording { primaryLinkUrl primaryLinkLabel } } } } }`; @@ -109,7 +111,7 @@ export const CallRecordingsPage = () => { const dirColor: 'blue' | 'brand' = call.direction === 'INBOUND' ? 'blue' : 'brand'; switch (colId) { case 'agent': - return {call.agentName || '—'}; + return {call.agent?.name ?? call.agentName ?? '—'}; case 'caller': return phone ? @@ -207,7 +209,7 @@ export const CallRecordingsPage = () => { if (search.trim()) { const q = search.toLowerCase(); result = result.filter(c => - (c.agentName ?? '').toLowerCase().includes(q) || + (c.agent?.name ?? c.agentName ?? '').toLowerCase().includes(q) || (c.callerNumber?.primaryPhoneNumber ?? '').includes(q) || (c.disposition ?? '').toLowerCase().includes(q), ); @@ -217,7 +219,7 @@ export const CallRecordingsPage = () => { const dir = sortDescriptor.direction === 'ascending' ? 1 : -1; result = [...result].sort((a, b) => { switch (sortDescriptor.column) { - case 'agent': return (a.agentName ?? '').localeCompare(b.agentName ?? '') * dir; + case 'agent': return (a.agent?.name ?? a.agentName ?? '').localeCompare(b.agent?.name ?? b.agentName ?? '') * dir; case 'dateTime': { const ta = a.startedAt ? new Date(a.startedAt).getTime() : 0; const tb = b.startedAt ? new Date(b.startedAt).getTime() : 0; diff --git a/src/pages/team-dashboard.tsx b/src/pages/team-dashboard.tsx index 3884c34..100bb15 100644 --- a/src/pages/team-dashboard.tsx +++ b/src/pages/team-dashboard.tsx @@ -1,6 +1,7 @@ import { useMemo, useState } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSidebarFlip, faSidebar } from '@fortawesome/pro-duotone-svg-icons'; +import { PageHeader } from '@/components/layout/page-header'; import { AiChatPanel } from '@/components/call-desk/ai-chat-panel'; import { DashboardKpi } from '@/components/dashboard/kpi-cards'; import { MissedQueue } from '@/components/dashboard/missed-queue'; @@ -55,36 +56,36 @@ export const TeamDashboardPage = () => { return (
- {/* Header */} -
-
-

Team Dashboard

- {dateRangeLabel} -
-
-
- {(['today', 'week', 'month'] as const).map((range) => ( - - ))} -
- -
-
+ +
+ {(['today', 'week', 'month'] as const).map((range) => ( + + ))} +
+ + + } + />
{/* Main content — scrollable column with KPIs pinned at the diff --git a/src/pages/team-performance.tsx b/src/pages/team-performance.tsx index 41036b6..0490afd 100644 --- a/src/pages/team-performance.tsx +++ b/src/pages/team-performance.tsx @@ -291,25 +291,28 @@ export const TeamPerformancePage = () => { if (loading) { return ( - <> - +
+

Loading team performance...

- +
); } return ( - <> - +
+ } + />
{/* Section 1: Key Metrics */}
-
+

Key Metrics

-
@@ -510,6 +513,6 @@ export const TeamPerformancePage = () => {
)}
- +
); };