import React from 'react'; import type { IAgentDashboardData } from '../../service/agent-analytics/agent-analytics.interface'; import KPICard from './KPICard'; import Section from './Section'; import HBar from './HBar'; import ChartCanvas from './ChartCanvas'; import EmptyState from './EmptyState'; import ErrorBanner from './ErrorBanner'; import { CardSkeleton, ChartSkeleton } from './CardSkeleton'; import { formatNumber, formatPercentage, RECOMAZE_COLORS } from './helpers'; import InfoTooltip from './InfoTooltip'; import { OVERVIEW_LINE_CHART_OPTIONS, buildDailyConversationsChartData, } from './overviewTab.utils'; // Native SVG Icons to replace react-icons const IconChat = ({ className = '' }) => ( ); const IconUsers = ({ className = '' }) => ( ); const IconPercent = ({ className = '' }) => ( ); const IconThumbUp = ({ className = '' }) => ( ); const IconCursorClick = ({ className = '' }) => ( ); const IconCart = ({ className = '' }) => ( ); interface OverviewTabProps { data: IAgentDashboardData | null; loading: boolean; error: string | null; onRetry: () => void; } const OverviewTab = ({ data, loading, error, onRetry, }: OverviewTabProps): JSX.Element => { if (loading) { return (
{formatNumber(o.avg_messages_per_conversation, 1)}
{formatNumber(o.avg_duration_minutes, 1)}{' '} min
{formatNumber(o.high_intent_conversations)}
{formatPercentage(o.high_intent_rate)} of total
{formatPercentage(o.returning_rate)}
{formatNumber(o.returning_visitors)} returning