Repository Public
1// « Toutes les boîtes » : boîte de réception unifiée, non lus, favoris, brouillons, envoyés et messages programmés de toutes2// les boîtes (ou d'un sous-ensemble choisi). Même liste virtualisée et même lecteur que la vue par boîte ; chaque ligne porte3// l'adresse qui a reçu le message. Module chargé à la demande.4import { Suspense, memo, useEffect, useId, useRef, useState } from "react"5import { fmtDateTime, fmtListDate, t } from "../i18n"6import { displayName } from "../mail/address"7import { addressHue, receivingAddress, type UnifiedView } from "../mail/unified"8import type { V1Message } from "../mail/v1"9import { S } from "../state/app"10import { R, requestRowContext, requestSnooze, useRowGlyphs, useRowLabels, useSelectionActions, type SelectionAction } from "../state/registry"11import { useSearchBar } from "../state/registry"12import { PaletteButton } from "./PaletteButton"13import { ownAddresses } from "../state/senders"14import { shallowEqual, useStore } from "../state/store"15import { U, cancelScheduled, loadMore, loadScheduled, moveRows, moveUnifiedCursor, openUnified, openUnifiedRow, refreshUnified, selectAllRows, setRead, setStarred, setSubset, startUnifiedSync, subsetIds, toggleSelected, unifiedGroups, unifiedTargets, rowKeywords, rowsPinned, setPinnedRows, type ScheduledItem } from "../state/unified"16import { RowLead, SkeletonList, SkeletonRow, SwipeLayer, VirtualRows, useRowSwipe, type SwipeActions } from "./MessageList"17import { SyncIndicator } from "./SyncIndicator"18import { Dialog, Icon, IconButton, MenuButton, confirmAsync, type IconName } from "./kit"19import { unifiedKeys } from "./unifiedKeys"2021const VIEW_LABEL: Record<UnifiedView, "unified.inbox" | "view.unread" | "view.flagged" | "folder.drafts" | "folder.sent" | "unified.scheduled"> = { inbox: "unified.inbox", unread: "view.unread", starred: "view.flagged", drafts: "folder.drafts", sent: "folder.sent", scheduled: "unified.scheduled" }22const VIEW_ICON: Record<UnifiedView, IconName> = { inbox: "inbox", unread: "unread", starred: "star", drafts: "draft", sent: "sent", scheduled: "clock" }2324// ---------------------------------------------------------------- pastille d'adresse25/** Adresse de réception, avec une couleur stable par adresse (un point : la couleur n'est jamais la seule information). */26export function AddressChip({ address, short }: { address: string; short: string }) {27 return (28 <span className="addr-chip" style={{ "--h": addressHue(address) } as React.CSSProperties} title={address} data-address={address}>29 <span className="addr-dot" aria-hidden="true" />30 <span className="truncate">{short}</span>31 </span>32 )33}34/** Partie locale seule quand elle suffit à distinguer mes adresses ; l'adresse entière sinon. */35function shortener(mine: readonly string[]): (address: string) => string {36 const locals = new Map<string, number>()37 for (const a of mine) locals.set(a.split("@")[0], (locals.get(a.split("@")[0]) ?? 0) + 1)38 return (address) => {39 const local = address.toLowerCase().split("@")[0]40 return (locals.get(local) ?? 0) > 1 ? address.toLowerCase() : local41 }42}4344// ---------------------------------------------------------------- sous-ensemble de boîtes45function SubsetDialog({ onClose }: { onClose: () => void }) {46 const boxes = useStore(S, (s) => s.me?.mailboxes ?? [])47 const [picked, setPicked] = useState<Set<string>>(() => {48 const cur = subsetIds()49 return new Set(cur.length ? cur : boxes.map((b) => b.id))50 })51 const toggle = (id: string, on: boolean) => {52 const next = new Set(picked)53 if (on) next.add(id)54 else next.delete(id)55 setPicked(next)56 }57 return (58 <Dialog59 title={t("unified.subset.title")}60 onClose={onClose}61 footer={62 <>63 <button type="button" className="btn" onClick={() => setPicked(new Set(boxes.map((b) => b.id)))}>64 {t("unified.subset.all")}65 </button>66 <button67 type="button"68 className="btn primary"69 disabled={picked.size === 0}70 onClick={() => {71 void setSubset([...picked])72 onClose()73 }}74 >75 {t("unified.subset.apply")}76 </button>77 </>78 }79 >80 <fieldset className="subset-list">81 <legend className="muted small">{t("unified.subset.hint")}</legend>82 {boxes.map((b) => (83 <label key={b.id} className="check subset-item">84 <input type="checkbox" checked={picked.has(b.id)} onChange={(e) => toggle(b.id, e.target.checked)} />85 <span className="addr-dot" style={{ "--h": addressHue(b.address) } as React.CSSProperties} aria-hidden="true" />86 <span className="truncate">{b.address}</span>87 </label>88 ))}89 </fieldset>90 </Dialog>91 )92}9394function Header({ view }: { view: UnifiedView }) {95 const boxes = useStore(S, (s) => s.me?.mailboxes ?? [])96 const subset = useStore(S, (s) => subsetIds(s), shallowEqual)97 const [dialog, setDialog] = useState(false)98 // le champ de recherche d'un module porte déjà le bouton de la palette (téléphone)99 const hasSearch = useSearchBar() !== null100 const chosen = boxes.filter((b) => subset.includes(b.id))101 return (102 <div className="search unified-head">103 <div className="search-form">104 <IconButton icon="menu" label={t("nav.open")} className="only-narrow" onClick={() => S.set({ navOpen: true })} />105 <span className="unified-crumb truncate">106 <Icon name={VIEW_ICON[view]} />107 <span className="truncate">{t("unified.all")}</span>108 </span>109 <span className="spacer" />110 {boxes.length > 1 ? (111 <button type="button" className="btn small subset-btn" onClick={() => setDialog(true)} aria-haspopup="dialog" data-testid="subset-button">112 <Icon name="filter" small />113 <span>{subset.length ? t("unified.subset.some", { n: subset.length, total: boxes.length }) : t("unified.subset.none")}</span>114 </button>115 ) : null}116 {hasSearch ? null : <PaletteButton />}117 <IconButton icon="refresh" label={t("unified.refresh")} onClick={() => void refreshUnified()} />118 <SyncIndicator compact />119 </div>120 {chosen.length ? (121 <ul className="chips" aria-label={t("unified.subset.active")}>122 {chosen.map((b) => (123 <li key={b.id} className="chip">124 <span className="addr-dot" style={{ "--h": addressHue(b.address) } as React.CSSProperties} aria-hidden="true" />125 <span className="truncate">{b.address}</span>126 <button type="button" aria-label={t("unified.subset.remove", { address: b.address })} onClick={() => void setSubset(subset.filter((id) => id !== b.id))}>127 <Icon name="close" small />128 </button>129 </li>130 ))}131 </ul>132 ) : null}133 {dialog ? <SubsetDialog onClose={() => setDialog(false)} /> : null}134 </div>135 )136}137138// ---------------------------------------------------------------- barre d'actions139/** Action d'un module (libellé, veille, rappel) sur des lignes : par groupes de boîtes si elle le sait, sinon boîte unique seulement. */140function runModuleAction(a: SelectionAction, rowIds: string[]) {141 const groups = unifiedGroups(rowIds).map(({ mailboxId, emailIds }) => ({ mailboxId, emailIds }))142 if (!groups.length) return143 if (a.runGroups) a.runGroups(groups)144 else if (groups.length === 1) a.run(groups[0].emailIds, groups[0].mailboxId)145}146/** Mise en veille des cibles : le module inscrit traite plusieurs boîtes ; sans lui, l'annonce d'origine. */147function snoozeRows(rowIds: string[]) {148 const groups = unifiedGroups(rowIds)149 if (!groups.length) return150 const a = R.get().selectionActions.find((x) => x.id === "snooze" && x.runGroups)151 if (a) runModuleAction(a, rowIds)152 else requestSnooze(groups[0].emailIds, groups[0].mailboxId)153}154155function Toolbar({ view }: { view: UnifiedView }) {156 const { count, loaded, more } = useStore(U, (u) => ({ count: u.selected.size, loaded: u.list.rows.length, more: u.list.hasMore }), shallowEqual)157 const scheduled = useStore(U, (u) => u.scheduled?.length ?? null)158 const extra = useSelectionActions().filter((a) => a.runGroups)159 const allSelected = count > 0 && count >= loaded160 const box = useRef<HTMLInputElement>(null)161 useEffect(() => {162 if (box.current) box.current.indeterminate = count > 0 && !allSelected163 }, [count, allSelected])164 const selected = () => [...U.get().selected]165 const title = `${t("unified.all")} — ${t(VIEW_LABEL[view])}`166 if (view === "scheduled")167 return (168 <div className="list-toolbar" role="toolbar" aria-label={t("list.toolbar")}>169 <h1 className="list-title truncate">{title}</h1>170 <span className="muted small list-count" aria-live="polite">171 {scheduled === null ? "" : t("unified.scheduled.count", { n: scheduled })}172 </span>173 </div>174 )175 return (176 <div className={`list-toolbar${count ? " selecting" : ""}`} role="toolbar" aria-label={t("list.toolbar")}>177 <label className="check list-selectall" title={t("list.selectAll")}>178 <input ref={box} type="checkbox" checked={allSelected} onChange={(e) => selectAllRows(e.target.checked)} disabled={!loaded} />179 <span className="sr-only">{t("list.selectAll")}</span>180 </label>181 {count === 0 ? (182 <>183 <h1 className="list-title truncate">{title}</h1>184 <span className="muted small list-count" aria-live="polite">185 {loaded ? (more ? t("unified.countMore", { n: loaded }) : t("unified.count", { n: loaded })) : ""}186 </span>187 </>188 ) : (189 <>190 <span className="list-selcount" aria-live="polite">191 {t("list.selected", { n: count })}192 </span>193 <span className="spacer" />194 <IconButton icon="mail" label={t("action.markRead")} onClick={() => void setRead(selected(), true)} />195 <IconButton icon="unread" label={t("action.markUnread")} onClick={() => void setRead(selected(), false)} />196 <IconButton icon="star" label={t("action.flag")} onClick={() => void setStarred(selected(), true)} />197 <IconButton icon="pin" label={rowsPinned(selected()) ? t("action.unpin") : t("action.pin")} shortcut="p" onClick={() => void setPinnedRows(selected(), !rowsPinned(selected()))} />198 {view !== "drafts" ? <IconButton icon="archive" label={t("action.archive")} shortcut="e" onClick={() => void moveRows(selected(), "archive")} /> : null}199 <IconButton icon="trash" label={t("action.delete")} shortcut="#" onClick={() => void moveRows(selected(), "trash")} />200 {extra.length && view !== "drafts" ? (201 <MenuButton202 label={t("list.moreActions")}203 items={[204 { label: t("action.unflag"), icon: "star", onSelect: () => void setStarred(selected(), false) },205 "sep",206 ...extra.map((a) => ({ label: a.label(), icon: a.icon, onSelect: () => runModuleAction(a, selected()) })),207 ]}208 />209 ) : null}210 </>211 )}212 </div>213 )214}215216// ---------------------------------------------------------------- lignes217const Row = memo(function Row({ id, index, top, total, mine, short }: { id: string; index: number; top: number; total: number; mine: readonly string[]; short: (a: string) => string }) {218 const m = useStore(U, (u) => u.list.rows[index]?.id === id ? u.list.rows[index] : u.list.rows.find((x) => x.id === id))219 const selected = useStore(U, (u) => u.selected.has(id))220 const isCursor = useStore(U, (u) => u.cursor === id)221 const outgoing = useStore(U, (u) => u.view === "sent" || u.view === "drafts")222 const view = useStore(U, (u) => u.view)223 const kw = useStore(U, (u) => u.kw[id])224 const labelsOf = useRowLabels()225 const glyphsOf = useRowGlyphs()226 // gestes au doigt, mêmes sens que la liste d'une boîte : lu / non lu, archiver (court), mettre en veille (long)227 const actions: SwipeActions | null =228 m && view !== "drafts" && !(typeof matchMedia === "function" && matchMedia("(hover: hover)").matches)229 ? {230 lead: { icon: m.unread ? "mail" : "unread", label: m.unread ? t("action.markRead") : t("action.markUnread"), run: () => void setRead([id], m.unread) },231 trail: { icon: "archive", label: t("action.archive"), run: () => void moveRows([id], "archive") },232 trailLong: { icon: "snooze", label: t("action.snooze"), run: () => snoozeRows([id]) },233 }234 : null235 const swipe = useRowSwipe(actions)236 if (!m) return <SkeletonRow top={top} />237 const keywords = rowKeywords(m, kw)238 const labels = labelsOf ? labelsOf({ keywords }) : []239 const glyphs = glyphsOf ? glyphsOf({ mailboxId: unifiedGroups([id])[0]?.mailboxId, keywords }) : []240 const pinned = !!keywords.$pinned241 const who = outgoing ? m.to.map((a) => displayName(a)).join(", ") || t("list.noRecipient") : displayName(m.from[0]) || t("list.unknownSender")242 const subject = m.subject?.trim() || t("list.noSubject")243 const address = receivingAddress(m, mine)244 const label = [m.unread ? t("list.unread") : "", who, subject, fmtListDate(m.received_at), outgoing ? t("unified.sentFrom", { address }) : t("unified.receivedBy", { address }), m.has_attachment ? t("list.hasAttachment") : "", m.starred ? t("list.flagged") : "", pinned ? t("list.pinned") : "", ...labels.map((l) => l.name), ...glyphs.map((g) => g.label)].filter(Boolean).join(", ")245 return (246 <div247 id={`row-${id}`}248 role="option"249 aria-selected={selected}250 aria-setsize={total}251 aria-posinset={index + 1}252 data-id={id}253 data-mailbox={m.mailbox}254 className={`mrow${m.unread ? " unread" : ""}${selected ? " selected" : ""}${isCursor ? " cursor" : ""}`}255 style={{ transform: `translateY(${top}px)` }}256 onClick={(e) => {257 if (swipe.swallowClick.current) return258 if (e.metaKey || e.ctrlKey) toggleSelected(id)259 else if (e.shiftKey) toggleSelected(id, true)260 else openUnifiedRow(id)261 }}262 onContextMenu={(e) => {263 // même menu que les listes de dossier (clic droit, appui long) : la sélection si la ligne en fait partie, sinon elle seule264 const sel = U.get().selected265 const groups = unifiedGroups(sel.has(id) ? [...sel] : [id]).map(({ mailboxId, emailIds }) => ({ mailboxId, emailIds }))266 if (groups.length && requestRowContext({ emailIds: groups[0].emailIds, mailboxId: groups[0].mailboxId, x: e.clientX, y: e.clientY, groups })) e.preventDefault()267 }}268 {...swipe.handlers}269 >270 <span className="sr-only">{label}</span>271 {actions ? <SwipeLayer actions={actions} /> : null}272 <span className="mrow-card" aria-hidden="true" ref={swipe.card}>273 <RowLead address={(outgoing ? m.to[0]?.email : m.from[0]?.email) ?? ""} name={(outgoing ? m.to[0]?.name : m.from[0]?.name) ?? ""} selected={selected} unread={m.unread} onToggle={(shift) => toggleSelected(id, shift)} />274 <span className="mrow-main">275 <span className="mrow-top">276 <span className="mrow-from truncate">{who}</span>277 <AddressChip address={address} short={short(address)} />278 <span className="mrow-icons">279 {labels.slice(0, 3).map((l) => (280 <span key={l.id} className="label-dot" style={{ background: l.color }} title={l.name} />281 ))}282 {glyphs.map((g) => (283 <span key={g.id} className={`mrow-glyph mrow-glyph-${g.id}`} title={g.label}>284 <Icon name={g.icon} small />285 </span>286 ))}287 {pinned ? <Icon name="pin" small className="pin" /> : null}288 {m.has_attachment ? <Icon name="attach" small /> : null}289 {m.answered ? <Icon name="reply" small /> : null}290 </span>291 <span className="mrow-date">{fmtListDate(m.received_at)}</span>292 </span>293 <span className="mrow-bottom">294 <span className="mrow-subject truncate">{subject}</span>295 <span className="mrow-preview">{m.preview}</span>296 </span>297 </span>298 <span299 className={`mrow-star${m.starred ? " on" : ""}`}300 title={m.starred ? t("action.unflag") : t("action.flag")}301 onClick={(e) => {302 e.stopPropagation()303 void setStarred([id], !m.starred)304 }}305 >306 <Icon name="star" />307 </span>308 </span>309 </div>310 )311})312313/** Sélection et favori d'une ligne pour les technologies d'assistance (voir RowControls de MessageList). */314const RowControls = memo(function RowControls({ id }: { id: string }) {315 const m = useStore(U, (u) => u.list.rows.find((x) => x.id === id))316 const selected = useStore(U, (u) => u.selected.has(id))317 if (!m) return null318 const subject = m.subject?.trim() || t("list.noSubject")319 return (320 <li>321 <label>322 <input type="checkbox" tabIndex={-1} checked={selected} onChange={() => toggleSelected(id)} />323 {t("list.selectRow", { subject })}324 </label>325 <button type="button" tabIndex={-1} aria-pressed={m.starred} onClick={() => void setStarred([id], !m.starred)}>326 {t("list.starRow", { subject })}327 </button>328 </li>329 )330})331332// ---------------------------------------------------------------- messages programmés333function ScheduledList() {334 const items = useStore(U, (u) => u.scheduled)335 const loading = useStore(U, (u) => u.loading)336 const error = useStore(U, (u) => u.error)337 const mine = useStore(S, (s) => ownAddresses(s), shallowEqual)338 const short = shortener(mine)339 if (error && !items?.length)340 return (341 <div className="empty" role="alert">342 <Icon name="warn" />343 <h2>{t("list.errorTitle")}</h2>344 <p>{t(`error.${error}`)}</p>345 <button type="button" className="btn" onClick={() => void loadScheduled()}>346 <Icon name="refresh" />347 <span>{t("common.retry")}</span>348 </button>349 </div>350 )351 if (items === null || (loading && !items.length))352 return (353 <SkeletonList />354 )355 if (!items.length)356 return (357 <div className="empty">358 <Icon name="clock" />359 <h2>{t("unified.scheduled.emptyTitle")}</h2>360 <p>{t("unified.scheduled.emptyBody")}</p>361 </div>362 )363 return (364 <ul className="sched-list" aria-label={t("unified.scheduled")}>365 {items.map((x) => (366 <ScheduledRow key={x.id} item={x} short={short} />367 ))}368 </ul>369 )370}371function ScheduledRow({ item, short }: { item: ScheduledItem; short: (a: string) => string }) {372 const [busy, setBusy] = useState(false)373 const subject = item.subject === undefined ? "…" : item.subject.trim() || t("list.noSubject")374 return (375 <li className="sched-item" data-testid="scheduled-item" data-outbound={item.id}>376 <div className="sched-main">377 <div className="row">378 <strong className="truncate">{subject}</strong>379 <AddressChip address={item.from} short={short(item.from)} />380 </div>381 <div className="small muted sched-rcpt">{t("unified.scheduled.to", { recipients: item.recipients.map((r) => r.address).join(", ") })}</div>382 <div className="small">383 <Icon name="clock" small className="sched-clock" /> {t("unified.scheduled.at", { date: fmtDateTime(item.send_at) })}384 </div>385 </div>386 <button387 type="button"388 className="btn small danger"389 disabled={busy}390 aria-label={t("unified.scheduled.cancelLabel", { subject })}391 onClick={async () => {392 if (!(await confirmAsync({ title: t("unified.scheduled.cancelTitle"), body: t("unified.scheduled.cancelBody", { subject }), confirmLabel: t("unified.scheduled.cancel"), danger: true }))) return393 setBusy(true)394 await cancelScheduled(item.id)395 setBusy(false)396 }}397 >398 {t("unified.scheduled.cancel")}399 </button>400 </li>401 )402}403404// ---------------------------------------------------------------- liste405function Body({ view }: { view: UnifiedView }) {406 const { loading, error, n, more, key, cursor } = useStore(U, (u) => ({ loading: u.loading, error: u.error, n: u.list.rows.length, more: u.list.hasMore, key: u.list.key, cursor: u.cursor }), shallowEqual)407 const ids = useStore(U, (u) => u.list.rows, (a, b) => a === b || (a.length === b.length && a.every((m, i) => m.id === b[i].id))).map((m: V1Message) => m.id)408 const mine = useStore(S, (s) => ownAddresses(s), shallowEqual)409 const short = shortener(mine)410 const labelId = useId()411 if (error && n === 0)412 return (413 <div className="empty" role="alert">414 <Icon name={error === "offline" ? "offline" : "warn"} />415 <h2>{t("list.errorTitle")}</h2>416 <p>{t(`error.${error}`)}</p>417 <button type="button" className="btn" onClick={() => openUnified(view)}>418 <Icon name="refresh" />419 <span>{t("common.retry")}</span>420 </button>421 </div>422 )423 if (loading && n === 0)424 return (425 <SkeletonList />426 )427 if (n === 0 && !more)428 return (429 <div className="empty" id={labelId}>430 <Icon name={VIEW_ICON[view]} />431 <h2>{t("list.emptyTitle")}</h2>432 <p>{view === "inbox" ? t("unified.emptyInbox") : t("list.emptyBody")}</p>433 </div>434 )435 return (436 <VirtualRows437 ids={ids}438 // une ligne d'attente annonce la page suivante439 total={n + (more ? 1 : 0)}440 cursor={cursor}441 label={t("list.aria", { name: `${t("unified.all")} — ${t(VIEW_LABEL[view])}` })}442 listKey={key}443 ensureRange={(_first, last) => {444 if (last >= n - 8) void loadMore()445 }}446 renderRow={(id, i, top, count) => <Row key={id} id={id} index={i} top={top} total={count} mine={mine} short={short} />}447 renderControls={(id) => <RowControls key={id} id={id} />}448 onFocusEmpty={() => {449 if (!U.get().cursor) moveUnifiedCursor(1)450 }}451 />452 )453}454455// ---------------------------------------------------------------- clavier456function handleKey(k: string, target: HTMLElement | null): boolean {457 const s = S.get()458 const u = U.get()459 if (u.view === "scheduled") return false460 const hasSelection = u.selected.size > 0461 // un fil est ouvert et rien n'est coché : archiver, supprimer, favori… visent ce fil (actions du lecteur, par boîte)462 const reader = !!s.open && !hasSelection463 switch (k) {464 case "j":465 case "ArrowDown":466 case "k":467 case "ArrowUp": {468 if ((k === "ArrowDown" || k === "ArrowUp") && !target?.closest("#message-list")) return false469 const id = moveUnifiedCursor(k === "j" || k === "ArrowDown" ? 1 : -1)470 if (id && s.open) openUnifiedRow(id)471 return true472 }473 case "o":474 case "Enter": {475 if (k === "Enter" && target && /^(BUTTON|A|SUMMARY)$/.test(target.tagName)) return false476 const id = u.cursor ?? moveUnifiedCursor(1)477 if (id) openUnifiedRow(id)478 return !!id479 }480 case " ":481 case "x": {482 if (k === " " && !target?.closest("#message-list")) return false483 const id = u.cursor ?? moveUnifiedCursor(1)484 if (id) toggleSelected(id)485 return !!id486 }487 case "Escape":488 if (!hasSelection || s.navOpen) return false489 U.set({ selected: new Set() })490 return true491 case "e":492 if (reader) return false493 void moveRows(unifiedTargets(), "archive")494 return true495 case "#":496 case "Delete":497 if (reader) return false498 void moveRows(unifiedTargets(), "trash")499 return true500 case "s": {501 if (reader) return false502 const ids = unifiedTargets()503 void setStarred(ids, ids.some((id) => !u.list.rows.find((m) => m.id === id)?.starred))504 return true505 }506 case "I":507 case "U":508 if (reader) return false509 void setRead(unifiedTargets(), k === "I")510 return true511 case "b":512 if (reader) return false513 snoozeRows(unifiedTargets())514 return true515 case "p": {516 if (reader) return false517 const ids = unifiedTargets()518 if (ids.length) void setPinnedRows(ids, !rowsPinned(ids))519 return true520 }521 case "!":522 return !reader // « indésirable » n'existe que dans le lecteur523 }524 return false525}526527export default function Unified() {528 const view = useStore(S, (s) => (s.route.name === "mail" && s.route.all ? (s.route.view as UnifiedView) : "inbox"))529 const ready = useStore(S, (s) => s.phase === "ready")530 const Search = useSearchBar()531 useEffect(() => {532 if (ready) openUnified(view)533 }, [view, ready])534 useEffect(() => {535 unifiedKeys.handle = handleKey536 const stop = startUnifiedSync()537 return () => {538 unifiedKeys.handle = null539 stop()540 }541 }, [])542 return (543 <section className="list-pane" id="list-pane" aria-label={t("list.region")} data-unified={view}>544 <Header view={view} />545 {/* champ de recherche inscrit par un module : il cherche dans toutes les boîtes */}546 {Search ? <Suspense fallback={null}><Search /></Suspense> : null}547 <Toolbar view={view} />548 {view === "scheduled" ? <ScheduledList /> : <Body view={view} />}549 </section>550 )551}552