feat: Enhance dashboard metrics with new calculations and add Top Questions Chart component

This commit is contained in:
Max Kowalski
2025-06-26 12:04:51 +02:00
parent 0e5ac69d45
commit 8f3c1e0f7c
5 changed files with 254 additions and 2 deletions

View File

@ -119,6 +119,11 @@ export interface WordCloudWord {
value: number;
}
export interface TopQuestion {
question: string;
count: number;
}
export interface MetricsResult {
totalSessions: number;
avgSessionsPerDay: number;
@ -152,6 +157,12 @@ export interface MetricsResult {
usersTrend?: number; // e.g., percentage change in uniqueUsers
avgSessionTimeTrend?: number; // e.g., percentage change in avgSessionLength
avgResponseTimeTrend?: number; // e.g., percentage change in avgResponseTime
// New metrics for enhanced dashboard
avgDailyCosts?: number; // Average daily costs in euros
peakUsageTime?: string; // Peak usage time (e.g., "14:00-15:00")
resolvedChatsPercentage?: number; // Percentage of resolved chats
topQuestions?: TopQuestion[]; // Top 5 most asked questions
// Debug properties
totalSessionDuration?: number;