@open-workspace/email 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -20
- package/alchemy/index.ts +273 -0
- package/drizzle/mailbox/0000_puzzling_dracula.sql +149 -0
- package/drizzle/mailbox/0001_mute_jack_flag.sql +12 -0
- package/drizzle/mailbox/meta/0000_snapshot.json +1002 -0
- package/drizzle/mailbox/meta/0001_snapshot.json +1002 -0
- package/drizzle/mailbox/meta/_journal.json +20 -0
- package/drizzle/mailbox/migrations.js +12 -0
- package/index.ts +3 -1
- package/migrations/0000_dry_moon_knight.sql +77 -0
- package/migrations/meta/0000_snapshot.json +248 -106
- package/migrations/meta/_journal.json +2 -2
- package/package.json +74 -68
- package/shared/attachment-preview.ts +37 -27
- package/shared/folder-order.ts +106 -0
- package/shared/mail-authentication.ts +8 -3
- package/shared/mail-feedback.ts +18 -25
- package/shared/mail-headers.ts +114 -39
- package/shared/mail-import.ts +38 -0
- package/shared/mail-path.ts +42 -0
- package/shared/mail-received.ts +174 -31
- package/shared/mail-remote.ts +59 -2
- package/shared/mail-sender-intel.ts +22 -4
- package/shared/mail.ts +78 -26
- package/shared/module.ts +33 -0
- package/shared/office-preview.ts +14 -2
- package/shared/pdfjs-assets.ts +35 -0
- package/shared/permissions.ts +73 -0
- package/shared/webhooks.ts +41 -0
- package/src/admin/blocked-senders.tsx +189 -0
- package/src/client.tsx +97 -0
- package/src/lib/mail-api.ts +9 -0
- package/src/mail/attachment-preview-dialog.tsx +161 -0
- package/src/mail/blocked-senders.tsx +138 -0
- package/src/mail/compose-window-chrome.tsx +194 -0
- package/src/mail/compose-window.tsx +486 -0
- package/src/mail/composer-asset-bookmarks.ts +409 -0
- package/src/mail/composer-asset.tsx +229 -0
- package/src/mail/composer-attachment-list.tsx +138 -0
- package/src/mail/composer-editor-document.ts +65 -0
- package/src/mail/composer-editor.tsx +284 -0
- package/src/mail/composer-linked-attachment-text.ts +12 -0
- package/src/mail/composer-recipient-fields.tsx +165 -0
- package/src/mail/composer-recipients.ts +208 -0
- package/src/mail/composer-session.ts +562 -0
- package/src/mail/composer-toolbar.tsx +303 -0
- package/src/mail/composer-upload-client.ts +105 -0
- package/src/mail/composer-upload-progress.ts +53 -0
- package/src/mail/conversation-list.tsx +550 -0
- package/src/mail/conversation-loading-skeleton.tsx +119 -0
- package/src/mail/conversation-message.tsx +346 -0
- package/src/mail/conversation-reply.tsx +470 -0
- package/src/mail/conversation-selection-toolbar.tsx +322 -0
- package/src/mail/conversation-view.tsx +437 -0
- package/src/mail/delivery-indicator.tsx +272 -0
- package/src/mail/email-html-body.tsx +203 -0
- package/src/mail/folder-glyph.tsx +46 -0
- package/src/mail/folder-manager.tsx +532 -0
- package/src/mail/format-bytes.ts +7 -0
- package/src/mail/mail-app-bar.tsx +253 -0
- package/src/mail/mail-background.tsx +12 -0
- package/src/mail/mail-dock.tsx +137 -0
- package/src/mail/mail-folders.ts +44 -0
- package/src/mail/mail-layout.css +236 -0
- package/src/mail/mail-location.ts +73 -0
- package/src/mail/mail-mailbox-sheet.tsx +275 -0
- package/src/mail/mail-nav-rail.tsx +129 -0
- package/src/mail/mail-nav.tsx +324 -0
- package/src/mail/mail-prefetch.ts +59 -0
- package/src/mail/mail-primitives.tsx +66 -0
- package/src/mail/mail-queries.ts +209 -0
- package/src/mail/mail-query-cache.ts +486 -0
- package/src/mail/mail-seed.ts +47 -0
- package/src/mail/mail-shell.tsx +126 -0
- package/src/mail/mailbox-ai-settings.tsx +185 -0
- package/src/mail/mailbox-realtime.tsx +251 -0
- package/src/mail/mailbox-route.tsx +15 -0
- package/src/mail/message-actions.tsx +353 -0
- package/src/mail/message-attachments.tsx +200 -0
- package/src/mail/message-format.ts +75 -0
- package/src/mail/message-header.tsx +260 -0
- package/src/mail/message-translation.tsx +225 -0
- package/src/mail/original-message-sheet.tsx +619 -0
- package/src/mail/original-message.ts +191 -0
- package/src/mail/outbound-notification.ts +53 -0
- package/src/mail/pane-splitter.tsx +117 -0
- package/src/mail/pdf-preview-toolbar.tsx +152 -0
- package/src/mail/pdf-preview.css +44 -0
- package/src/mail/pdf-preview.tsx +156 -0
- package/src/mail/pdf-translation-layout.ts +95 -0
- package/src/mail/print-message.ts +92 -0
- package/src/mail/reader-pane.tsx +535 -0
- package/src/mail/recipient-combobox.tsx +335 -0
- package/src/mail/recipient-field-row.tsx +34 -0
- package/src/mail/reply-to-warning.tsx +50 -0
- package/src/mail/sanitize-email-html.ts +430 -0
- package/src/mail/sender-actions.tsx +149 -0
- package/src/mail/sender-authentication.tsx +485 -0
- package/src/mail/sender-dialogs.tsx +384 -0
- package/src/mail/sender-security.tsx +545 -0
- package/src/mail/toolbar-tooltip.tsx +29 -0
- package/src/mail/translation-html.ts +49 -0
- package/src/mail/translation-language.ts +21 -0
- package/src/mail/types.ts +53 -0
- package/src/mail/unread-document-indicator.tsx +60 -0
- package/src/mail/use-compose-submission.ts +208 -0
- package/src/mail/use-composer-attachment-preflight.ts +184 -0
- package/src/mail/use-composer-submission.ts +117 -0
- package/src/mail/use-conversation-selection.ts +186 -0
- package/src/mail/use-mail-controller.ts +427 -0
- package/src/mail/use-mail-data.ts +279 -0
- package/src/mail/use-mail-safety.ts +155 -0
- package/src/mail/use-mail-send.ts +142 -0
- package/src/mail/use-pdf-translation-overlay.ts +156 -0
- package/src/mail/use-pdf-translation.ts +100 -0
- package/src/mail/use-pdf-viewer.ts +215 -0
- package/src/mail/use-reply-submission.ts +114 -0
- package/src/mail/use-sanitized-email-html.ts +20 -0
- package/src/mail/use-visible-message-read.ts +138 -0
- package/src/pwa/push-subscription.ts +151 -0
- package/src/settings/mail-apps-page.tsx +235 -0
- package/src/settings/notifications-page.tsx +291 -0
- package/worker/admin/blocked-sender-routes.ts +166 -0
- package/worker/admin/schemas.ts +11 -0
- package/worker/bindings.d.ts +14 -10
- package/worker/db/schema.ts +90 -34
- package/worker/jmap/eventsource.ts +169 -0
- package/worker/jmap/methods.ts +1716 -361
- package/worker/jmap/push-types.ts +27 -0
- package/worker/jmap/push.ts +207 -0
- package/worker/jmap/routes.ts +448 -86
- package/worker/mail/access.ts +258 -21
- package/worker/mail/ai-classification.ts +36 -20
- package/worker/mail/ai-translation.ts +13 -6
- package/worker/mail/auth-headers.ts +395 -137
- package/worker/mail/bimi.ts +200 -73
- package/worker/mail/bootstrap.ts +79 -0
- package/worker/mail/capped-body.ts +36 -0
- package/worker/mail/classification-signals.ts +35 -25
- package/worker/mail/conversation-cursor.ts +30 -19
- package/worker/mail/delivery-events.ts +88 -62
- package/worker/mail/delivery-facts.ts +46 -10
- package/worker/mail/demo-routes.ts +34 -10
- package/worker/mail/doh.ts +62 -23
- package/worker/mail/downloads.ts +75 -40
- package/worker/mail/edge-cache.ts +155 -0
- package/worker/mail/header-metadata.ts +84 -52
- package/worker/mail/impersonation.ts +160 -38
- package/worker/mail/import-routes.ts +313 -0
- package/worker/mail/inbound-delivery.ts +19 -9
- package/worker/mail/inbound-threading.ts +18 -8
- package/worker/mail/inbound.ts +82 -40
- package/worker/mail/ip-intel.ts +110 -27
- package/worker/mail/isolate-cache.ts +35 -0
- package/worker/mail/link-domains.ts +29 -7
- package/worker/mail/mailbox-deletion.ts +10 -4
- package/worker/mail/mailbox-directory.ts +16 -6
- package/worker/mail/mailing-list.ts +94 -39
- package/worker/mail/message-security.ts +90 -15
- package/worker/mail/message-view.ts +18 -6
- package/worker/mail/office-conversion.ts +31 -9
- package/worker/mail/office-preview-container.ts +40 -13
- package/worker/mail/office-preview-queue.ts +76 -32
- package/worker/mail/org-domain.ts +8 -1
- package/worker/mail/outbound-content.ts +71 -26
- package/worker/mail/outbound-delivery.ts +31 -17
- package/worker/mail/outbound-service.ts +48 -30
- package/worker/mail/outbound-threading.ts +30 -17
- package/worker/mail/outbound.ts +97 -70
- package/worker/mail/outgoing-context.ts +25 -15
- package/worker/mail/participants.ts +44 -29
- package/worker/mail/push-notifications.ts +283 -171
- package/worker/mail/quote-parser.ts +21 -10
- package/worker/mail/r2-presigned-urls.ts +31 -25
- package/worker/mail/receive.ts +23 -11
- package/worker/mail/recipients.ts +6 -1
- package/worker/mail/remote-proxy.ts +187 -31
- package/worker/mail/remote-routes.ts +87 -0
- package/worker/mail/remote-token.ts +104 -0
- package/worker/mail/repeat.ts +19 -0
- package/worker/mail/reply-plan.ts +62 -33
- package/worker/mail/rfc.ts +32 -7
- package/worker/mail/routes.ts +871 -542
- package/worker/mail/safety-routes.ts +329 -202
- package/worker/mail/schemas.ts +84 -105
- package/worker/mail/search.ts +1 -0
- package/worker/mail/security-settings.ts +41 -9
- package/worker/mail/sender-intel.ts +206 -51
- package/worker/mail/spamhaus.ts +92 -45
- package/worker/mail/unsubscribe.ts +76 -18
- package/worker/mail/uploads.ts +153 -91
- package/worker/mail/webhook-source.ts +35 -12
- package/worker/mail/workspace-safety.ts +97 -38
- package/worker/mailbox/demo-html.ts +7 -7
- package/worker/mailbox/demo-seed.ts +10 -44
- package/worker/mailbox/demo.ts +597 -227
- package/worker/mailbox/email-index.ts +53 -0
- package/worker/mailbox/folder-model.ts +53 -17
- package/worker/mailbox/import-placement.ts +88 -0
- package/worker/mailbox/inbox-counts.ts +106 -0
- package/worker/mailbox/index.ts +1761 -737
- package/worker/mailbox/jmap-store.ts +139 -35
- package/worker/mailbox/model.ts +7 -14
- package/worker/mailbox/office-preview-jobs.ts +56 -25
- package/worker/mailbox/schema.ts +87 -66
- package/worker/mailbox/senders.ts +176 -70
- package/worker/mcp/mail-action-tools.ts +128 -87
- package/worker/mcp/mail-compose-tools.ts +133 -82
- package/worker/mcp/mail-query-tools.ts +120 -71
- package/worker/mcp/mail-safety-tools.ts +321 -248
- package/worker/mcp/schemas.ts +43 -0
- package/worker/mcp/tools.ts +13 -10
- package/worker/module.ts +43 -18
- package/worker/sql.d.ts +8 -0
- package/alchemy.ts +0 -126
- package/containers/office-preview/Dockerfile +0 -10
- package/migrations/0000_email.sql +0 -53
- package/shared/mail-rules.ts +0 -156
- package/worker/admin/report-routes.ts +0 -164
- package/worker/mail/reported-messages.ts +0 -68
- package/worker/mailbox/legacy-migrations.ts +0 -41
- package/worker/mailbox/migrations.ts +0 -10
- package/worker/mailbox/rules.ts +0 -110
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { Skeleton, cn } from "@open-workspace/core/ui";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
|
|
4
|
+
import { translatedEmailHtml } from "./translation-html";
|
|
5
|
+
import type { MessageDetail } from "./types";
|
|
6
|
+
import { useSanitizedEmailHtml } from "./use-sanitized-email-html";
|
|
7
|
+
|
|
8
|
+
/** Reading measure and rhythm shared by plain-text bodies. */
|
|
9
|
+
export const messageTextClassName =
|
|
10
|
+
"max-w-[72ch] whitespace-pre-wrap text-[14.5px] leading-[1.7] [overflow-wrap:anywhere]";
|
|
11
|
+
|
|
12
|
+
const MIN_FRAME_HEIGHT = 48;
|
|
13
|
+
|
|
14
|
+
// Bounds a runaway document; real emails render at full height without an
|
|
15
|
+
// inner scrollbar.
|
|
16
|
+
const MAX_FRAME_HEIGHT = 20_000;
|
|
17
|
+
|
|
18
|
+
export function EmailHtmlBody({
|
|
19
|
+
mailboxId,
|
|
20
|
+
message,
|
|
21
|
+
translations,
|
|
22
|
+
}: {
|
|
23
|
+
mailboxId: string;
|
|
24
|
+
message: MessageDetail;
|
|
25
|
+
translations?: string[];
|
|
26
|
+
}) {
|
|
27
|
+
const iframe = useRef<HTMLIFrameElement>(null);
|
|
28
|
+
const frameObserver = useRef<ResizeObserver | null>(null);
|
|
29
|
+
|
|
30
|
+
// The document the frame finished loading and laid out, and its height.
|
|
31
|
+
const [loadedFrame, setLoadedFrame] = useState<{
|
|
32
|
+
srcDoc: string;
|
|
33
|
+
height: number;
|
|
34
|
+
} | null>(null);
|
|
35
|
+
|
|
36
|
+
const html = useSanitizedEmailHtml(mailboxId, message);
|
|
37
|
+
|
|
38
|
+
const composerHtml =
|
|
39
|
+
translations && message.direction === "outgoing" && html.data?.composerHtml
|
|
40
|
+
? translatedEmailHtml(html.data.composerHtml, translations, false)
|
|
41
|
+
: html.data?.composerHtml;
|
|
42
|
+
|
|
43
|
+
const srcDoc =
|
|
44
|
+
translations && message.direction === "incoming" && html.data?.srcDoc
|
|
45
|
+
? translatedEmailHtml(html.data.srcDoc, translations, true)
|
|
46
|
+
: html.data?.srcDoc;
|
|
47
|
+
|
|
48
|
+
// A new document shows the skeleton until it has loaded and been fitted.
|
|
49
|
+
const fitted = srcDoc && loadedFrame?.srcDoc === srcDoc ? loadedFrame : null;
|
|
50
|
+
const frameReady = fitted !== null;
|
|
51
|
+
const height = fitted?.height ?? MIN_FRAME_HEIGHT;
|
|
52
|
+
|
|
53
|
+
useEffect(
|
|
54
|
+
() => () => {
|
|
55
|
+
frameObserver.current?.disconnect();
|
|
56
|
+
frameObserver.current = null;
|
|
57
|
+
},
|
|
58
|
+
[]
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
function observeFrameSize() {
|
|
62
|
+
const frame = iframe.current;
|
|
63
|
+
const document = frame?.contentDocument;
|
|
64
|
+
|
|
65
|
+
if (!frame || !document || !srcDoc) return;
|
|
66
|
+
const loadedSrcDoc = srcDoc;
|
|
67
|
+
|
|
68
|
+
// Fixed-width newsletters (often 600–700px) are scaled down to the pane,
|
|
69
|
+
// like desktop mail clients do, instead of being clipped on the right.
|
|
70
|
+
let scale = 1;
|
|
71
|
+
|
|
72
|
+
const updateHeight = () => {
|
|
73
|
+
const { body } = document;
|
|
74
|
+
|
|
75
|
+
if (!body) return;
|
|
76
|
+
const contentHeight = Math.max(body.scrollHeight, body.offsetHeight);
|
|
77
|
+
setLoadedFrame({
|
|
78
|
+
srcDoc: loadedSrcDoc,
|
|
79
|
+
height: Math.min(
|
|
80
|
+
MAX_FRAME_HEIGHT,
|
|
81
|
+
Math.max(MIN_FRAME_HEIGHT, Math.ceil(contentHeight * scale))
|
|
82
|
+
),
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const updateLayout = () => {
|
|
87
|
+
const { body } = document;
|
|
88
|
+
|
|
89
|
+
if (!body) return;
|
|
90
|
+
|
|
91
|
+
for (const property of [
|
|
92
|
+
"transform",
|
|
93
|
+
"transform-origin",
|
|
94
|
+
"width",
|
|
95
|
+
"max-width",
|
|
96
|
+
]) {
|
|
97
|
+
body.style.removeProperty(property);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const available = frame.clientWidth;
|
|
101
|
+
let natural = body.scrollWidth;
|
|
102
|
+
|
|
103
|
+
if (available > 0 && natural > available) {
|
|
104
|
+
// The sanitizer pins the body to 100% with !important, so widen it
|
|
105
|
+
// the same way, then measure again: tables capped at 100% can grow.
|
|
106
|
+
body.style.setProperty("max-width", "none", "important");
|
|
107
|
+
body.style.setProperty("width", `${natural}px`, "important");
|
|
108
|
+
natural = Math.max(natural, body.scrollWidth);
|
|
109
|
+
body.style.setProperty("width", `${natural}px`, "important");
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
scale = available > 0 && natural > available ? available / natural : 1;
|
|
113
|
+
|
|
114
|
+
if (scale < 1) {
|
|
115
|
+
body.style.setProperty("transform-origin", "0 0");
|
|
116
|
+
body.style.setProperty("transform", `scale(${scale})`);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
updateHeight();
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
frameObserver.current?.disconnect();
|
|
123
|
+
updateLayout();
|
|
124
|
+
let lastWidth = frame.clientWidth;
|
|
125
|
+
frameObserver.current = new ResizeObserver((entries) => {
|
|
126
|
+
// A new frame width (pane splitter, window) needs a new fit; content
|
|
127
|
+
// changes inside the body (late images, fonts) only change the height.
|
|
128
|
+
if (
|
|
129
|
+
entries.some((entry) => entry.target === frame) &&
|
|
130
|
+
frame.clientWidth !== lastWidth
|
|
131
|
+
) {
|
|
132
|
+
lastWidth = frame.clientWidth;
|
|
133
|
+
updateLayout();
|
|
134
|
+
} else {
|
|
135
|
+
updateHeight();
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
frameObserver.current.observe(frame);
|
|
139
|
+
frameObserver.current.observe(document.body ?? document.documentElement);
|
|
140
|
+
// Shown now, measured or not (a document without a body has no height yet).
|
|
141
|
+
setLoadedFrame((current) =>
|
|
142
|
+
current?.srcDoc === loadedSrcDoc
|
|
143
|
+
? current
|
|
144
|
+
: { srcDoc: loadedSrcDoc, height: MIN_FRAME_HEIGHT }
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const fallback = (
|
|
149
|
+
<div className={messageTextClassName}>
|
|
150
|
+
{message.bodyText || message.preview || "No text body"}
|
|
151
|
+
</div>
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
if (html.isPending) {
|
|
155
|
+
return <BodySkeleton />;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (message.direction === "outgoing") {
|
|
159
|
+
return composerHtml ? (
|
|
160
|
+
<div
|
|
161
|
+
className="composer-message-body max-w-[72ch] text-[14.5px] leading-[1.7]"
|
|
162
|
+
// oxlint-disable-next-line react/no-danger -- composerHtml is sanitized email HTML
|
|
163
|
+
dangerouslySetInnerHTML={{ __html: composerHtml }}
|
|
164
|
+
/>
|
|
165
|
+
) : (
|
|
166
|
+
fallback
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (!html.data?.renderAsHtml || !srcDoc) return fallback;
|
|
171
|
+
|
|
172
|
+
return (
|
|
173
|
+
<div className="relative">
|
|
174
|
+
{frameReady ? null : <BodySkeleton />}
|
|
175
|
+
<iframe
|
|
176
|
+
ref={iframe}
|
|
177
|
+
className={cn(
|
|
178
|
+
"dark:ring-border block w-full overflow-hidden rounded-md bg-white dark:ring-1",
|
|
179
|
+
frameReady
|
|
180
|
+
? "relative opacity-100"
|
|
181
|
+
: "pointer-events-none absolute inset-x-0 top-0 h-0 opacity-0"
|
|
182
|
+
)}
|
|
183
|
+
style={frameReady ? { height } : undefined}
|
|
184
|
+
title={`HTML body of ${message.subject}`}
|
|
185
|
+
sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin"
|
|
186
|
+
referrerPolicy="no-referrer"
|
|
187
|
+
srcDoc={srcDoc}
|
|
188
|
+
onLoad={observeFrameSize}
|
|
189
|
+
/>
|
|
190
|
+
</div>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function BodySkeleton() {
|
|
195
|
+
return (
|
|
196
|
+
<div aria-hidden="true" className="max-w-[72ch] space-y-2.5 py-1">
|
|
197
|
+
<Skeleton className="h-3.5 w-11/12" />
|
|
198
|
+
<Skeleton className="h-3.5 w-full" />
|
|
199
|
+
<Skeleton className="h-3.5 w-4/5" />
|
|
200
|
+
<Skeleton className="h-3.5 w-2/5" />
|
|
201
|
+
</div>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Archive,
|
|
3
|
+
Folder as FolderIcon,
|
|
4
|
+
Inbox,
|
|
5
|
+
Send,
|
|
6
|
+
ShieldAlert,
|
|
7
|
+
Trash2,
|
|
8
|
+
} from "lucide-react";
|
|
9
|
+
import type { LucideProps } from "lucide-react";
|
|
10
|
+
|
|
11
|
+
import type { MailFolder } from "./types";
|
|
12
|
+
|
|
13
|
+
/** A folder's icon: its system folder's own, a plain folder for the rest. */
|
|
14
|
+
export function FolderGlyph({
|
|
15
|
+
folder,
|
|
16
|
+
...props
|
|
17
|
+
}: LucideProps & { folder: MailFolder }) {
|
|
18
|
+
if (folder.kind === "custom") return <FolderIcon {...props} />;
|
|
19
|
+
|
|
20
|
+
switch (folder.systemType) {
|
|
21
|
+
case "inbox": {
|
|
22
|
+
return <Inbox {...props} />;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
case "sent": {
|
|
26
|
+
return <Send {...props} />;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
case "archive": {
|
|
30
|
+
return <Archive {...props} />;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
case "spam": {
|
|
34
|
+
return <ShieldAlert {...props} />;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
case "trash": {
|
|
38
|
+
return <Trash2 {...props} />;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// A folder without a system type.
|
|
42
|
+
default: {
|
|
43
|
+
return <FolderIcon {...props} />;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|