${escapeHtml(email.preview)}
` : "") openComposeWithInitial({ to, subject: email.subject, bodyHtml: body, focusToOnMount: false, focusBodyOnMount: true, }) }, [markEmailSeen, openComposeWithInitial] ) const handleRowActivate = useCallback( (email: Email) => { if (email.labels?.includes("scheduled")) return if (email.labels?.includes("drafts")) { openDraftInCompose(email) return } handleOpenEmail(email.id) }, [handleOpenEmail, openDraftInCompose] ) const viewModeIsRead = useMemo(() => { if (!openEmail) return true return readOverrides[openEmail.id] !== undefined ? readOverrides[openEmail.id]! : openEmail.read }, [openEmail, readOverrides]) const afterSingleMessageRemoved = useCallback( (removedId: string) => { if (splitView) navigateToMail(pickAdjacentMailId(removedId)) else navigateToMail(null) }, [splitView, navigateToMail, pickAdjacentMailId] ) const singleArchive = useCallback(() => { if (!openMailId) return const id = openMailId mailActions.hideEmail(id) afterSingleMessageRemoved(id) }, [openMailId, afterSingleMessageRemoved, mailActions]) const singleDelete = useCallback(() => { if (!openMailId) return const id = openMailId mailActions.hideEmail(id) afterSingleMessageRemoved(id) }, [openMailId, afterSingleMessageRemoved, mailActions]) const singleSpam = useCallback(() => { if (!openMailId) return const id = openMailId mailActions.hideEmail(id) afterSingleMessageRemoved(id) }, [openMailId, afterSingleMessageRemoved, mailActions]) const singleNotSpam = useCallback(() => { if (!openMailId) return const id = openMailId mailActions.markNotSpam(id) onSelectFolder?.("inbox") afterSingleMessageRemoved(id) }, [openMailId, afterSingleMessageRemoved, onSelectFolder, mailActions]) const singleToggleRead = useCallback(() => { if (!openMailId) return setReadOverrides((prev) => ({ ...prev, [openMailId]: !viewModeIsRead })) }, [openMailId, viewModeIsRead]) const singleMoveTo = useCallback( (targetId: string) => { if (!openMailId) return moveEmailsToTarget([openMailId], targetId) const isSystemHide = ["sent", "drafts", "spam", "trash"].includes(targetId) if (isSystemHide || targetId !== "inbox") { afterSingleMessageRemoved(openMailId) } }, [openMailId, afterSingleMessageRemoved, moveEmailsToTarget] ) useEffect(() => { if (!splitView) return const firstId = filteredEmails[0]?.id ?? null if (!openMailId) { if (firstId) navigateToMail(firstId) return } const raw = allEmails.find((e) => e.id === openMailId) if (raw?.labels?.includes("scheduled")) { navigateToMail(firstId) return } if (!filteredEmails.some((e) => e.id === openMailId)) { navigateToMail(firstId) } }, [ splitView, selectedFolder, inboxTab, listPage, filteredEmails, openMailId, navigateToMail, allEmails, ]) const handleNavigateToLabel = useCallback( (label: string) => { const folderId = sidebarNav.emailLabelToSidebarFolderId[label] ?? label onSelectFolder?.(folderId) }, [onSelectFolder, sidebarNav.emailLabelToSidebarFolderId] ) useEffect(() => { onFolderUnreadCountsChange?.(folderUnreadCounts) }, [folderUnreadCounts, onFolderUnreadCountsChange]) const listRowsDep = listEmails.map((e) => e.id).join(",") useLayoutEffect(() => { if (!splitView || !openMailId) return const scrollActiveRowIntoView = () => { const root = listViewportRef.current if (!root) return const row = root.querySelector{filteredEmails.length} message{filteredEmails.length !== 1 ? "s" : ""} {mobileUnreadCount > 0 && ` · ${mobileUnreadCount} non lu${mobileUnreadCount !== 1 ? "s" : ""}`}
Les messages de la liste « Envois programmés » seront envoyés à l'heure prévue pour chacun d'eux.
Aucun message planifié.
{email.preview}
Nouvelle date d'envoi
setRescheduleTarget((prev) => prev?.id === email.id ? { ...prev, value: e.target.value, panelOpen: true, } : prev ) } />Nouvelle date d'envoi {contextTargetIds.length > 1 ? ` (${contextTargetIds.length} messages)` : null}
setCmScheduledRescheduleValue(e.target.value) } onPointerDown={(e) => e.stopPropagation()} />