"use client" import { EditorContent } from "@tiptap/react" import { Maximize2, X } from "lucide-react" import { readCoarsePointerMatches } from "@/hooks/use-touch-nav" import type { ComposeState } from "@/lib/compose-context" import type { Email } from "@/lib/email-data" import { cn } from "@/lib/utils" import { MAIL_COMPOSE_TITLEBAR_CLASS, MAIL_ICON_BTN, } from "@/lib/mail-chrome-classes" import { ComposeRecipientFields } from "@/components/gmail/compose/compose-recipients" import { ComposeBottomToolbar, FormattingToolbar, } from "@/components/gmail/compose/compose-toolbar" import { ComposeAttachmentsList, ComposeDockTitleBar, ComposeDropOverlay, ComposeInlineRecipientHeader, ComposeXsSheetHeader, } from "@/components/gmail/compose/compose-editor-chrome" import { useComposeWindow } from "@/components/gmail/compose/use-compose-window" export function ComposeWindow({ compose, threadSourceEmail = null, isXsSheet = false, bindXsSheetClose, }: { compose: ComposeState /** Fil courant : nécessaire pour le menu Répondre / Transférer en inline */ threadSourceEmail?: Email | null /** Plein écran dans une bottom sheet (xs) — pas de file ni réduction */ isXsSheet?: boolean bindXsSheetClose?: (fn: (() => void) | null) => void }) { const { isInline, isEditingScheduled, editor, titleText, showFormatting, setShowFormatting, recipientsFocused, setRecipientsFocused, sendMenuOpen, setSendMenuOpen, isDragOver, fieldsRef, inlineRecipientShellRef, fileInputRef, imageInputRef, handleClose, handleSend, saveScheduledEdit, sendScheduledFromEditNow, applyScheduledPlanAt, submitScheduledSendAt, addFiles, removeAttachment, handleDrop, handleDragOver, handleDragLeave, recipientSummary, showReplyAllInMenu, ThreadKindIcon, openInlinePreset, openDockFromInline, recipientFieldsProps, toggleMinimize, toggleMaximize, updateCompose, } = useComposeWindow(compose, threadSourceEmail, isXsSheet, bindXsSheetClose) const modalContent = (