feat: add floating call widget with SIP controls, click-to-call, and SIP provider

Introduce a shared SipProvider context so all components use the same SIP
connection. Add a floating CallWidget (idle pill, ringing, active with
disposition, ended states) visible for CC agents on every page. Add a
ClickToCallButton for the worklist. Wire SIP status badge and worklist
into the call-desk page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-17 18:08:46 +05:30
parent d5feaab75a
commit b2cc3d7012
5 changed files with 454 additions and 11 deletions

View File

@@ -1,6 +1,9 @@
import type { ReactNode } from "react";
import { useLocation } from "react-router";
import { Sidebar } from "./sidebar";
import type { ReactNode } from 'react';
import { useLocation } from 'react-router';
import { Sidebar } from './sidebar';
import { SipProvider } from '@/providers/sip-provider';
import { CallWidget } from '@/components/call-desk/call-widget';
import { useAuth } from '@/providers/auth-provider';
interface AppShellProps {
children: ReactNode;
@@ -8,11 +11,15 @@ interface AppShellProps {
export const AppShell = ({ children }: AppShellProps) => {
const { pathname } = useLocation();
const { isCCAgent } = useAuth();
return (
<div className="flex min-h-screen bg-primary">
<Sidebar activeUrl={pathname} />
<main className="flex flex-1 flex-col overflow-auto">{children}</main>
</div>
<SipProvider>
<div className="flex min-h-screen bg-primary">
<Sidebar activeUrl={pathname} />
<main className="flex flex-1 flex-col overflow-auto">{children}</main>
{isCCAgent && <CallWidget />}
</div>
</SipProvider>
);
};