Spaces:
Build error
Build error
Upload components/EmailDetail.js with huggingface_hub
Browse files- components/EmailDetail.js +80 -0
components/EmailDetail.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Reply, Forward, Trash2, Archive, MoreVertical, Star, User } from 'lucide-react';
|
| 2 |
+
|
| 3 |
+
export default function EmailDetail({ email, onDelete }) {
|
| 4 |
+
return (
|
| 5 |
+
<div className="h-full flex flex-col">
|
| 6 |
+
{/* Toolbar */}
|
| 7 |
+
<div className="p-4 border-b border-slate-200 flex items-center justify-between shrink-0">
|
| 8 |
+
<div className="flex items-center gap-4">
|
| 9 |
+
<button className="p-2 hover:bg-slate-100 rounded-full text-slate-600">
|
| 10 |
+
<Archive size={18} />
|
| 11 |
+
</button>
|
| 12 |
+
<button
|
| 13 |
+
onClick={onDelete}
|
| 14 |
+
className="p-2 hover:bg-red-50 rounded-full text-slate-600 hover:text-red-500 transition-colors"
|
| 15 |
+
>
|
| 16 |
+
<Trash2 size={18} />
|
| 17 |
+
</button>
|
| 18 |
+
<div className="w-px h-6 bg-slate-200 mx-1" />
|
| 19 |
+
<button className="p-2 hover:bg-slate-100 rounded-full text-slate-600">
|
| 20 |
+
<Star size={18} />
|
| 21 |
+
</button>
|
| 22 |
+
</div>
|
| 23 |
+
<div className="flex items-center gap-2">
|
| 24 |
+
<button className="p-2 hover:bg-slate-100 rounded-full text-slate-600">
|
| 25 |
+
<MoreVertical size={18} />
|
| 26 |
+
</button>
|
| 27 |
+
</div>
|
| 28 |
+
</div>
|
| 29 |
+
|
| 30 |
+
{/* Email Content */}
|
| 31 |
+
<div className="flex-1 p-8 overflow-y-auto">
|
| 32 |
+
<div className="max-w-3xl mx-auto">
|
| 33 |
+
<h1 className="text-2xl font-semibold text-slate-800 mb-8">{email.subject}</h1>
|
| 34 |
+
|
| 35 |
+
<div className="flex items-center justify-between mb-8">
|
| 36 |
+
<div className="flex items-center gap-3">
|
| 37 |
+
<div className="w-10 h-10 bg-slate-200 rounded-full flex items-center justify-center text-slate-600 font-bold">
|
| 38 |
+
<User size={20} />
|
| 39 |
+
</div>
|
| 40 |
+
<div>
|
| 41 |
+
<div className="font-medium text-slate-900">{email.sender}</div>
|
| 42 |
+
<div className="text-xs text-slate-500">to me <span className="mx-1">路</span> {email.date}</div>
|
| 43 |
+
</div>
|
| 44 |
+
</div>
|
| 45 |
+
<div className="flex gap-2">
|
| 46 |
+
<span className="px-2 py-1 bg-slate-100 text-slate-600 text-xs rounded font-medium">
|
| 47 |
+
{email.label}
|
| 48 |
+
</span>
|
| 49 |
+
<span className={`px-2 py-1 text-xs rounded font-medium ${
|
| 50 |
+
email.priority === 'high' ? 'bg-red-100 text-red-600' :
|
| 51 |
+
email.priority === 'medium' ? 'bg-yellow-100 text-yellow-600' : 'bg-blue-100 text-blue-600'
|
| 52 |
+
}`}>
|
| 53 |
+
{email.priority} Priority
|
| 54 |
+
</span>
|
| 55 |
+
</div>
|
| 56 |
+
</div>
|
| 57 |
+
|
| 58 |
+
<div className="text-slate-700 leading-relaxed whitespace-pre-wrap mb-12">
|
| 59 |
+
{email.body}
|
| 60 |
+
<br /><br />
|
| 61 |
+
Best regards,<br />
|
| 62 |
+
The {email.sender} Team
|
| 63 |
+
</div>
|
| 64 |
+
|
| 65 |
+
{/* Action Buttons */}
|
| 66 |
+
<div className="flex gap-3">
|
| 67 |
+
<button className="flex items-center gap-2 px-6 py-2 border border-slate-300 rounded-full text-slate-600 hover:bg-slate-50 transition-colors font-medium">
|
| 68 |
+
<Reply size={16} />
|
| 69 |
+
Reply
|
| 70 |
+
</button>
|
| 71 |
+
<button className="flex items-center gap-2 px-6 py-2 border border-slate-300 rounded-full text-slate-600 hover:bg-slate-50 transition-colors font-medium">
|
| 72 |
+
<Forward size={16} />
|
| 73 |
+
Forward
|
| 74 |
+
</button>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
</div>
|
| 78 |
+
</div>
|
| 79 |
+
);
|
| 80 |
+
}
|