From bb004744f47c7abb185805ffce56f4cdba4ec6f5 Mon Sep 17 00:00:00 2001 From: saridsa2 Date: Thu, 19 Mar 2026 16:23:10 +0530 Subject: [PATCH] =?UTF-8?q?feat:=20polish=20all=20pages=20=E2=80=94=20tool?= =?UTF-8?q?tips,=20sticky=20headers,=20roles,=20search,=20AI=20prompts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dashboard KPI: - Fix 1534m → 25h 34m (formatMinutes helper) - Add info icon tooltips on all KPI and metric cards - Pass role="admin" to AI panel for manager-specific prompts Settings: - Add search + pagination to employee table - Infer roles from email convention (platform roles API returns null via API key) AI Assistant: - Role-specific quick prompts: manager sees "Agent performance", "Missed risks" - Agent sees "Doctor availability", "Treatment packages" Sticky headers: - Add overflow-hidden to campaigns and all-leads pages Misc: - Fix free-brands-svg-icons → pro-duotone in integrations - Remove Follow-ups from CC agent sidebar - Remove global search from TopBar Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/call-desk/ai-chat-panel.tsx | 15 ++++-- src/components/dashboard/kpi-cards.tsx | 44 ++++++++++----- src/pages/all-leads.tsx | 2 +- src/pages/campaigns.tsx | 2 +- src/pages/settings.tsx | 62 ++++++++++++++++++++-- src/pages/team-dashboard.tsx | 2 +- 6 files changed, 104 insertions(+), 23 deletions(-) diff --git a/src/components/call-desk/ai-chat-panel.tsx b/src/components/call-desk/ai-chat-panel.tsx index 39a9b55..c1a7fd3 100644 --- a/src/components/call-desk/ai-chat-panel.tsx +++ b/src/components/call-desk/ai-chat-panel.tsx @@ -19,16 +19,25 @@ type CallerContext = { interface AiChatPanelProps { callerContext?: CallerContext; + role?: 'cc-agent' | 'admin' | 'executive'; } -const QUICK_ASK_BUTTONS = [ +const QUICK_ASK_AGENT = [ { label: 'Doctor availability', template: 'What are the visiting hours for all doctors?' }, { label: 'Clinic timings', template: 'What are the clinic locations and timings?' }, { label: 'Patient history', template: 'Can you summarize this patient\'s history?' }, { label: 'Treatment packages', template: 'What treatment packages are available?' }, ]; -export const AiChatPanel = ({ callerContext }: AiChatPanelProps) => { +const QUICK_ASK_MANAGER = [ + { label: 'Agent performance', template: 'Which agents have the highest appointment conversion rates this week?' }, + { label: 'Missed call risks', template: 'Which missed calls have been waiting the longest without a callback?' }, + { label: 'Pending leads', template: 'How many leads are still pending first contact?' }, + { label: 'Weekly summary', template: 'Give me a summary of this week\'s team performance — total calls, conversions, missed calls.' }, +]; + +export const AiChatPanel = ({ callerContext, role = 'cc-agent' }: AiChatPanelProps) => { + const quickButtons = role === 'admin' ? QUICK_ASK_MANAGER : QUICK_ASK_AGENT; const [messages, setMessages] = useState([]); const [input, setInput] = useState(''); const [isLoading, setIsLoading] = useState(false); @@ -112,7 +121,7 @@ export const AiChatPanel = ({ callerContext }: AiChatPanelProps) => { {/* Quick ask buttons */} {messages.length === 0 && (
- {QUICK_ASK_BUTTONS.map((btn) => ( + {quickButtons.map((btn) => ( + +
+ + )} )} diff --git a/src/pages/team-dashboard.tsx b/src/pages/team-dashboard.tsx index c9ffd74..328f4de 100644 --- a/src/pages/team-dashboard.tsx +++ b/src/pages/team-dashboard.tsx @@ -153,7 +153,7 @@ export const TeamDashboardPage = () => { )}> {aiOpen && (
- +
)}