"use client" import { useMemo, useState } from "react" import { Archive, ArrowLeft, Inbox, Pencil, RotateCcw, Search, Send, Star, Trash2, X, } from "lucide-react" import { toast } from "sonner" import { Button } from "@/components/ui/button" import { avatarColor, senderInitial } from "@/lib/sender-display" import { DEMO_EMAILS, DEMO_USER, type DemoEmail, type DemoFolder, } from "@/components/demo/demo-mail-data" import { cn } from "@/lib/utils" const FOLDERS: { id: DemoFolder; label: string; icon: typeof Inbox }[] = [ { id: "inbox", label: "Boîte de réception", icon: Inbox }, { id: "starred", label: "Favoris", icon: Star }, { id: "sent", label: "Envoyés", icon: Send }, { id: "archive", label: "Archive", icon: Archive }, { id: "trash", label: "Corbeille", icon: Trash2 }, ] function demoToast(message: string) { toast.message(message, { description: "Mode démo : rien n'est envoyé ni conservé.", }) } function Avatar({ name, className }: { name: string; className?: string }) { return ( {senderInitial(name)} ) } function ComposeModal({ onClose, onSend, }: { onClose: () => void onSend: (email: { to: string; subject: string; body: string }) => void }) { const [to, setTo] = useState("") const [subject, setSubject] = useState("") const [body, setBody] = useState("") return (
Nouveau message
setTo(e.target.value)} placeholder="À" className="bg-transparent py-2.5 text-sm text-[var(--mail-text)] outline-none placeholder:text-[var(--mail-text-muted)]" /> setSubject(e.target.value)} placeholder="Objet" className="bg-transparent py-2.5 text-sm text-[var(--mail-text)] outline-none placeholder:text-[var(--mail-text-muted)]" />