This repository was archived by the owner on Mar 12, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathEmailThread.tsx
More file actions
59 lines (56 loc) · 2.19 KB
/
Copy pathEmailThread.tsx
File metadata and controls
59 lines (56 loc) · 2.19 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
import { useEmails } from "@/lib/hooks/use-emails";
import { Reply } from "./Reply";
export function EmailThread() {
const { emails } = useEmails();
return (
<main className="flex h-full flex-col items-center justify-between">
<div className="flex h-full w-full flex-col">
<header className="border-b px-6 py-4">
<h2 className="text-2xl font-semibold">
Email Thread: Project Kickoff Meeting
</h2>
</header>
<div className="flex flex-1">
<div className="flex w-full flex-col border-r bg-muted">
<div className="flex-1 overflow-y-auto p-4">
<div className="space-y-4">
{emails.map((email) => (
<div
key={`${email.from}-${email.timestamp}`}
className="rounded-md border bg-background p-4 space-y-1"
>
<p className="text-sm text-muted-foreground">
{new Date(email.timestamp).toLocaleDateString()}{" "}
{new Date(email.timestamp).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
hour12: true,
})}
</p>
<div className="flex items-center justify-between">
<div className="space-y-1">
<p className="text-sm font-medium">
<span className="text-muted-foreground">From:</span>{" "}
{email.from}
</p>
<p className="text-sm font-medium">
<span className="text-muted-foreground">To:</span>{" "}
{email.to}
</p>
<p className="text-sm text-muted-foreground">
{email.body}
</p>
</div>
</div>
</div>
))}
<hr className="my-2" />
<Reply />
</div>
</div>
</div>
</div>
</div>
</main>
);
}