forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverviewSection.tsx
More file actions
92 lines (85 loc) · 2.9 KB
/
Copy pathOverviewSection.tsx
File metadata and controls
92 lines (85 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
'use client';
import { motion } from 'framer-motion';
import { MessageSquare, Clock, CheckSquare } from 'lucide-react';
import { cn } from '@/lib/utils';
import type { DailySummary } from '@/types/recap';
interface OverviewSectionProps {
recap: DailySummary;
}
// Format duration in minutes to human-readable
function formatDuration(minutes: number): string {
if (minutes < 60) {
return `${minutes} min`;
}
const hours = Math.floor(minutes / 60);
const mins = minutes % 60;
return mins > 0 ? `${hours}h ${mins}m` : `${hours} hours`;
}
export function OverviewSection({ recap }: OverviewSectionProps) {
return (
<motion.div
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.2 }}
className="space-y-4"
>
{/* Stats row */}
<div className="grid grid-cols-3 gap-3">
{/* Conversations */}
<div
className={cn(
'flex flex-col items-center justify-center p-3 rounded-xl',
'bg-gradient-to-b from-white/[0.03] to-white/[0.01]',
'border border-white/[0.04]',
)}
>
<MessageSquare className="w-5 h-5 text-text-primary mb-1" />
<span className="text-lg font-semibold text-text-primary">
{recap.stats.total_conversations}
</span>
<span className="text-[10px] text-text-tertiary">Conversations</span>
</div>
{/* Duration */}
<div
className={cn(
'flex flex-col items-center justify-center p-3 rounded-xl',
'bg-gradient-to-b from-white/[0.03] to-white/[0.01]',
'border border-white/[0.04]',
)}
>
<Clock className="w-5 h-5 text-blue-400 mb-1" />
<span className="text-lg font-semibold text-text-primary">
{formatDuration(recap.stats.total_duration_minutes)}
</span>
<span className="text-[10px] text-text-tertiary">Recorded</span>
</div>
{/* Action Items */}
<div
className={cn(
'flex flex-col items-center justify-center p-3 rounded-xl',
'bg-gradient-to-b from-white/[0.03] to-white/[0.01]',
'border border-white/[0.04]',
)}
>
<CheckSquare className="w-5 h-5 text-success mb-1" />
<span className="text-lg font-semibold text-text-primary">
{recap.stats.action_items_count}
</span>
<span className="text-[10px] text-text-tertiary">Action Items</span>
</div>
</div>
{/* Overview text */}
{recap.overview && (
<div
className={cn(
'p-4 rounded-xl',
'bg-gradient-to-b from-white/[0.03] to-white/[0.01]',
'border border-white/[0.04]',
)}
>
<p className="text-sm text-text-secondary leading-relaxed">{recap.overview}</p>
</div>
)}
</motion.div>
);
}