Open History to see the last commit
1import type {
2 ChatAttachment,
3 ChatFileAttachment,
4 EnvironmentId,
5 ScopedThreadRef,
6 SnapShotSource,
7} from "@t3tools/contracts";
8import { formatAttachmentSize } from "@t3tools/client-runtime/state/attachments";
9import { CircleAlertIcon, PaperclipIcon, PlayIcon, XIcon } from "lucide-react";
10import { type ComponentProps, useLayoutEffect, useRef } from "react";
11
12import {
13 type ComposerFileAttachment,
14 type ComposerImageAttachment,
15 type DraftId,
16 composerFileNeedsReattach,
17} from "../../composerDraftStore";
18import { retryAttachmentUpload, useAttachmentUploadStore } from "../../lib/attachmentUploadQueue";
19import { formatAttachmentUploadProgress } from "../../lib/attachmentUploadState";
20import { isHeicImageFile } from "../../lib/imageCompression";
21import {
22 type PendingSnapShotAnimation,
23 scheduleSnapShotAnimationDestination,
24 setSnapShotAnimationDestination,
25 shouldAnimateSnapShotArrival,
26} from "../../lib/snapShotAnimation";
27import { cn } from "~/lib/utils";
28import { getRestingComposerImagePreviewCounts } from "../composerFooterLayout";
29import { RefreshIcon } from "~/components/ui/refresh-icon";
30import { AttachmentFilePreview } from "../files/AttachmentFilePreview";
31import { AttachmentImage } from "../media/AttachmentImage";
32import { Button } from "../ui/button";
33import { Dialog, DialogPopup, DialogTitle } from "../ui/dialog";
34import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
35import { ComposerImageThumbnail } from "./ComposerImageThumbnail";
36import { composerFloatingLayerProps } from "./composerEventScope";
37import {
38 attachVideoThumbnail,
39 buildExpandedImagePreview,
40 type ExpandedImagePreview,
41} from "./ExpandedImagePreview";
42import { PierreEntryIcon } from "./PierreEntryIcon";
43import {
44 SNAP_SHOT_ATTACHMENT_FRAME_CLASS,
45 SnapShotAttachmentDetails,
46} from "./SnapShotAttachmentDetails";
47import { prepareVideoFirstFrame } from "../../lib/videoFirstFrame";
48
49function ComposerVideoThumbnail({ file }: { file: File }) {
50 const setVideo = (video: HTMLVideoElement | null) => {
51 if (!video) return;
52 return attachVideoThumbnail(video, file);
53 };
54
55 return (
56 <video
57 ref={setVideo}
58 muted
59 playsInline
60 preload="metadata"
61 aria-hidden="true"
62 onLoadedMetadata={(event) => prepareVideoFirstFrame(event.currentTarget)}
63 className="pointer-events-none absolute inset-0 size-full object-cover"
64 />
65 );
66}
67
68function SnapShotAttachmentFrame({
69 animationId,
70 animationSource,
71 arrival,
72 animateArrival,
73 className,
74 ...props
75}: ComponentProps<"div"> & {
76 readonly animationId?: string | undefined;
77 readonly animationSource?: SnapShotSource | undefined;
78 readonly arrival?: boolean | undefined;
79 readonly animateArrival?: boolean | undefined;
80}) {
81 const frameRef = useRef<HTMLDivElement>(null);
82
83 useLayoutEffect(() => {
84 const frame = frameRef.current;
85 if (!frame || (!animationId && !arrival)) return;
86 frame.scrollIntoView({ block: "nearest", inline: "nearest" });
87 if (!animationId) return;
88
89 return scheduleSnapShotAnimationDestination(animationId, () =>
90 setSnapShotAnimationDestination(animationId, frame, animationSource),
91 );
92 }, [animationId, animationSource, arrival]);
93
94 return (
95 <div
96 ref={frameRef}
97 className={cn(
98 animateArrival &&
99 !animationId &&
100 "origin-center transition-[opacity,scale] duration-300 ease-drawer starting:scale-95 starting:opacity-0 motion-reduce:transition-none motion-reduce:starting:scale-100 motion-reduce:starting:opacity-100",
101 className,
102 )}
103 {...props}
104 />
105 );
106}
107
108/** Image, SnapShot and video tiles above the composer editor. */
109export function ComposerAttachmentMediaRow({
110 images,
111 expandedImages,
112 videos,
113 pendingSnapShotAnimations,
114 pendingSnapShotIds,
115 uncommittedSnapShotIds,
116 nonPersistedImageIds,
117 snapShotAnimations,
118 supportsAttachmentUploads,
119 maxFileAttachmentBytes,
120 environmentId,
121 attachmentDraftTarget,
122 canOperateThread,
123 onExpandImage,
124 onFileOpen,
125 onRemoveImage,
126 onRemoveFile,
127}: {
128 readonly images: ReadonlyArray<ComposerImageAttachment>;
129 readonly expandedImages: ReadonlyArray<ComposerImageAttachment>;
130 readonly videos: ReadonlyArray<ComposerFileAttachment>;
131 readonly pendingSnapShotAnimations: ReadonlyArray<PendingSnapShotAnimation>;
132 readonly pendingSnapShotIds: ReadonlyArray<string>;
133 readonly uncommittedSnapShotIds: ReadonlyArray<string>;
134 readonly nonPersistedImageIds: ReadonlyArray<string>;
135 readonly snapShotAnimations: boolean;
136 readonly supportsAttachmentUploads: boolean;
137 readonly maxFileAttachmentBytes: number | null;
138 readonly environmentId: EnvironmentId;
139 readonly attachmentDraftTarget: ScopedThreadRef | DraftId;
140 readonly canOperateThread: boolean;
141 readonly onExpandImage: (preview: ExpandedImagePreview) => void;
142 readonly onFileOpen: (attachment: ChatFileAttachment) => void;
143 readonly onRemoveImage: (imageId: string) => void;
144 readonly onRemoveFile: (fileId: string) => void;
145}) {
146 const uploadsByImageId = useAttachmentUploadStore((state) => state.uploadsByImageId);
147 const pendingSnapShotIdSet = new Set(pendingSnapShotIds);
148 const nonPersistedImageIdSet = new Set(nonPersistedImageIds);
149 return (
150 <div
151 className={cn(
152 "mb-3 flex max-w-full gap-2",
153 pendingSnapShotIds.length > 0 ||
154 expandedImages.some((image) => image.source?.kind === "snap-shot")
155 ? "snap-x snap-proximity overflow-x-auto overscroll-x-contain pb-1 scrollbar-thumb-foreground/18 scrollbar-track-transparent [scrollbar-width:thin] [&::-webkit-scrollbar]:h-2.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:border-3 [&::-webkit-scrollbar-thumb]:border-transparent [&::-webkit-scrollbar-thumb]:bg-foreground/18 [&::-webkit-scrollbar-thumb]:bg-clip-content [&::-webkit-scrollbar-thumb:hover]:bg-foreground/28 [&::-webkit-scrollbar-track]:mx-1 [&::-webkit-scrollbar-track]:bg-transparent"
156 : "flex-wrap",
157 )}
158 >
159 {expandedImages
160 .map((image) => {
161 const upload = supportsAttachmentUploads ? uploadsByImageId[image.id] : undefined;
162 const snapShotAnimationPending =
163 image.source?.kind === "snap-shot" && pendingSnapShotIdSet.has(image.id);
164 const snapShotArrival =
165 image.source?.kind === "snap-shot" &&
166 shouldAnimateSnapShotArrival(image.source.capturedAt);
167 return (
168 <SnapShotAttachmentFrame
169 key={image.id}
170 data-chat-composer-expanded-image="true"
171 aria-hidden={snapShotAnimationPending || undefined}
172 inert={snapShotAnimationPending || undefined}
173 arrival={snapShotArrival}
174 animateArrival={snapShotAnimations && !snapShotAnimationPending && snapShotArrival}
175 animationId={snapShotAnimationPending ? image.id : undefined}
176 animationSource={snapShotAnimationPending ? image.source : undefined}
177 className={cn(
178 "group/attachment shrink-0 snap-start bg-background",
179 image.source?.kind === "snap-shot"
180 ? SNAP_SHOT_ATTACHMENT_FRAME_CLASS
181 : "relative h-16 w-16 overflow-hidden rounded-lg border border-border/80",
182 snapShotAnimationPending && "invisible",
183 )}
184 >
185 {image.previewUrl ? (
186 <button
187 type="button"
188 className="h-full w-full cursor-zoom-in"
189 aria-label={`Preview ${image.name}`}
190 onClick={() => {
191 const preview = buildExpandedImagePreview(images, image.id);
192 if (!preview) return;
193 onExpandImage(preview);
194 }}
195 >
196 <ComposerImageThumbnail
197 file={image.file}
198 alt={image.name}
199 className="h-full w-full object-cover"
200 fallback={
201 isHeicImageFile({ name: image.name, type: image.mimeType }) ? (
202 <AttachmentImage
203 name={image.name}
204 mimeType={image.mimeType}
205 src={image.previewUrl}
206 alt={image.name}
207 className="h-full w-full object-cover"
208 />
209 ) : (
210 <span className="flex h-full items-center justify-center px-1 text-3xs text-secondary-label">
211 {image.name}
212 </span>
213 )
214 }
215 />
216 </button>
217 ) : (
218 <div className="flex h-full w-full items-center justify-center px-1 text-center text-3xs text-secondary-label">
219 {image.name}
220 </div>
221 )}
222 {image.source?.kind === "snap-shot" ? (
223 <SnapShotAttachmentDetails
224 source={image.source}
225 className={cn(
226 upload?.status === "uploading" && "bottom-4",
227 upload?.status === "failed" && "bottom-8",
228 )}
229 />
230 ) : null}
231 {nonPersistedImageIdSet.has(image.id) && (
232 <Tooltip>
233 <TooltipTrigger
234 render={
235 <span
236 role="img"
237 aria-label="Draft attachment may not persist"
238 className="absolute left-1 top-1 inline-flex items-center justify-center rounded bg-background/85 p-0.5 text-warning-foreground"
239 >
240 <CircleAlertIcon className="size-3" />
241 </span>
242 }
243 />
244 <TooltipPopup side="top">
245 Draft attachment could not be saved locally and may be lost on navigation.
246 </TooltipPopup>
247 </Tooltip>
248 )}
249 {upload?.status === "uploading" && (
250 <span className="pointer-events-none absolute inset-x-0 bottom-0 bg-background/85 px-1 text-center text-3xs text-foreground">
251 {formatAttachmentUploadProgress(upload.progress)}
252 </span>
253 )}
254 {upload?.status === "failed" && (
255 <Tooltip>
256 <TooltipTrigger
257 render={
258 <Button
259 variant="overlay"
260 size="icon-xs"
261 className="absolute bottom-1 left-1"
262 onClick={() =>
263 retryAttachmentUpload({
264 environmentId,
265 image,
266 draftTarget: attachmentDraftTarget,
267 })
268 }
269 disabled={!canOperateThread}
270 aria-label={`Retry upload for ${image.name}`}
271 />
272 }
273 >
274 <RefreshIcon />
275 </TooltipTrigger>
276 <TooltipPopup side="top">{upload.reason}</TooltipPopup>
277 </Tooltip>
278 )}
279 <span
280 className={cn(
281 "absolute right-1 top-1 flex",
282 image.source?.kind === "snap-shot" &&
283 "opacity-0 transition-opacity pointer-coarse:opacity-100 group-hover/attachment:opacity-100 group-focus-within/attachment:opacity-100",
284 )}
285 >
286 <Button
287 variant="media-close"
288 size="icon-xs"
289 onClick={() => onRemoveImage(image.id)}
290 aria-label={`Remove ${image.name}`}
291 >
292 <XIcon />
293 </Button>
294 </span>
295 </SnapShotAttachmentFrame>
296 );
297 })
298 .concat(
299 uncommittedSnapShotIds.map((captureId) => (
300 <SnapShotAttachmentFrame
301 key={captureId}
302 aria-hidden="true"
303 animationId={captureId}
304 animationSource={
305 pendingSnapShotAnimations.find((capture) => capture.id === captureId)?.source
306 }
307 className={cn(
308 SNAP_SHOT_ATTACHMENT_FRAME_CLASS,
309 "invisible shrink-0 snap-start bg-background",
310 )}
311 />
312 )),
313 )}
314 {videos.map((file) => {
315 const fileCanUpload =
316 supportsAttachmentUploads &&
317 maxFileAttachmentBytes !== null &&
318 file.sizeBytes <= maxFileAttachmentBytes;
319 const upload = fileCanUpload ? uploadsByImageId[file.id] : undefined;
320 return (
321 <div
322 key={file.id}
323 className="relative h-16 w-16 shrink-0 snap-start overflow-hidden rounded-lg border border-border/80 bg-black"
324 >
325 <button
326 type="button"
327 className="flex h-full w-full cursor-zoom-in flex-col items-center justify-center gap-1 px-1 text-white"
328 aria-label={`Play ${file.name}`}
329 onClick={() => {
330 if (file.file !== null) {
331 const preview = buildExpandedImagePreview([file], file.id);
332 if (preview) onExpandImage(preview);
333 return;
334 }
335 if (!file.uploadedAttachmentId) return;
336 onFileOpen({ ...file, id: file.uploadedAttachmentId });
337 }}
338 >
339 {file.file && (
340 <>
341 <ComposerVideoThumbnail file={file.file} />
342 <span className="pointer-events-none absolute inset-0 bg-gradient-to-t from-black/70 via-black/10 to-black/10" />
343 </>
344 )}
345 <PlayIcon className="relative z-10 size-4 fill-current drop-shadow-md" />
346 </button>
347 {upload?.status === "uploading" && (
348 <span className="pointer-events-none absolute inset-x-0 bottom-0 bg-background/85 px-1 text-center text-3xs text-foreground">
349 {formatAttachmentUploadProgress(upload.progress)}
350 </span>
351 )}
352 {upload?.status === "failed" && (
353 <Tooltip>
354 <TooltipTrigger
355 render={
356 <Button
357 variant="overlay"
358 size="icon-xs"
359 className="absolute bottom-1 left-1"
360 onClick={() =>
361 retryAttachmentUpload({
362 environmentId,
363 image: file,
364 draftTarget: attachmentDraftTarget,
365 })
366 }
367 disabled={!canOperateThread}
368 aria-label={`Retry upload for ${file.name}`}
369 />
370 }
371 >
372 <RefreshIcon />
373 </TooltipTrigger>
374 <TooltipPopup side="top">{upload.reason}</TooltipPopup>
375 </Tooltip>
376 )}
377 <Button
378 variant="media-close"
379 size="icon-xs"
380 className="absolute right-1 top-1"
381 onClick={() => onRemoveFile(file.id)}
382 aria-label={`Remove ${file.name}`}
383 >
384 <XIcon />
385 </Button>
386 </div>
387 );
388 })}
389 </div>
390 );
391}
392
393/** Non-media file attachments, listed under the media row. */
394export function ComposerAttachmentFileList({
395 files,
396 resolvedTheme,
397 supportsAttachmentUploads,
398 maxFileAttachmentBytes,
399 fileStagingLimit,
400 environmentId,
401 attachmentDraftTarget,
402 canOperateThread,
403 onPreviewFile,
404 onRemoveFile,
405}: {
406 readonly files: ReadonlyArray<ComposerFileAttachment>;
407 readonly resolvedTheme: "light" | "dark";
408 readonly supportsAttachmentUploads: boolean;
409 readonly maxFileAttachmentBytes: number | null;
410 readonly fileStagingLimit: number | null;
411 readonly environmentId: EnvironmentId;
412 readonly attachmentDraftTarget: ScopedThreadRef | DraftId;
413 readonly canOperateThread: boolean;
414 readonly onPreviewFile: (fileId: string) => void;
415 readonly onRemoveFile: (fileId: string) => void;
416}) {
417 const uploadsByImageId = useAttachmentUploadStore((state) => state.uploadsByImageId);
418 return (
419 <div className="mb-3 flex flex-col gap-1">
420 {files.map((file) => {
421 const fileCanUpload =
422 supportsAttachmentUploads &&
423 maxFileAttachmentBytes !== null &&
424 file.sizeBytes <= maxFileAttachmentBytes;
425 const upload = fileCanUpload ? uploadsByImageId[file.id] : undefined;
426 const needsReattach = composerFileNeedsReattach(file);
427 const canReattachFile = fileStagingLimit !== null && file.sizeBytes <= fileStagingLimit;
428 return (
429 <div
430 key={file.id}
431 className="flex min-w-0 items-center gap-2 py-1 text-sm text-foreground"
432 >
433 <PierreEntryIcon pathValue={file.name} kind="file" theme={resolvedTheme} />
434 <button
435 type="button"
436 disabled={needsReattach}
437 className="min-w-0 flex-1 truncate text-left hover:underline focus-visible:outline-2"
438 onClick={() => onPreviewFile(file.id)}
439 >
440 {file.name}
441 </button>
442 <span className="shrink-0 text-xs text-secondary-label">
443 {needsReattach
444 ? canReattachFile
445 ? "Attach again"
446 : "Remove to send"
447 : upload?.status === "uploading"
448 ? formatAttachmentUploadProgress(upload.progress)
449 : formatAttachmentSize(file.sizeBytes)}
450 </span>
451 {!needsReattach && upload?.status === "failed" ? (
452 <Tooltip>
453 <TooltipTrigger
454 render={
455 <Button
456 variant="ghost"
457 size="icon-xs"
458 onClick={() =>
459 retryAttachmentUpload({
460 environmentId,
461 image: file,
462 draftTarget: attachmentDraftTarget,
463 })
464 }
465 disabled={!canOperateThread}
466 aria-label={`Retry upload for ${file.name}`}
467 />
468 }
469 >
470 <RefreshIcon />
471 </TooltipTrigger>
472 <TooltipPopup side="top">{upload.reason}</TooltipPopup>
473 </Tooltip>
474 ) : null}
475 <Button
476 variant="ghost"
477 size="icon-xs"
478 onClick={() => onRemoveFile(file.id)}
479 aria-label={`Remove ${file.name}`}
480 >
481 <XIcon />
482 </Button>
483 </div>
484 );
485 })}
486 </div>
487 );
488}
489
490export function ComposerFilePreviewDialog({
491 file,
492 onRemove,
493 onPreviewFileIdChange,
494}: {
495 readonly file: ComposerFileAttachment;
496 readonly onRemove: (fileId: string) => void;
497 readonly onPreviewFileIdChange: (fileId: string | null) => void;
498}) {
499 const onClose = () => onPreviewFileIdChange(null);
500 return (
501 <Dialog
502 open
503 onOpenChange={(open) => {
504 if (!open) onClose();
505 }}
506 >
507 <DialogPopup
508 {...composerFloatingLayerProps}
509 className="h-[min(85vh,52rem)] max-w-4xl overflow-hidden"
510 showCloseButton={false}
511 >
512 <DialogTitle className="sr-only">{file.name}</DialogTitle>
513 <AttachmentFilePreview
514 key={file.id}
515 name={file.name}
516 mimeType={file.mimeType}
517 sizeBytes={file.sizeBytes}
518 file={file.file}
519 origin="Draft"
520 {...(file.uploadedAttachmentId && file.uploadEnvironmentId
521 ? {
522 asset: {
523 environmentId: file.uploadEnvironmentId,
524 attachmentId: file.uploadedAttachmentId,
525 },
526 }
527 : {})}
528 onRemove={() => {
529 onRemove(file.id);
530 onClose();
531 }}
532 onClose={onClose}
533 />
534 </DialogPopup>
535 </Dialog>
536 );
537}
538
539/** Thumbnails beside the single-line prompt while the composer rests. */
540export function ComposerRestingImagePreviews({
541 images,
542 allImages,
543 resolvedTheme,
544 onExpandImage,
545 onShowMore,
546}: {
547 readonly images: ReadonlyArray<ComposerImageAttachment>;
548 readonly allImages: ReadonlyArray<ComposerImageAttachment>;
549 readonly resolvedTheme: "light" | "dark";
550 readonly onExpandImage: (preview: ExpandedImagePreview) => void;
551 readonly onShowMore: () => void;
552}) {
553 const counts = getRestingComposerImagePreviewCounts(images.length);
554 const visibleImages = images.slice(0, counts.visibleCount);
555 return (
556 <div data-chat-composer-resting-images="true" className="flex shrink-0 items-center gap-1 ps-1">
557 {visibleImages.map((image) => (
558 <button
559 key={image.id}
560 type="button"
561 className="relative size-7 shrink-0 cursor-zoom-in overflow-hidden rounded-md border border-border/70 bg-muted/60"
562 aria-label={`Preview ${image.name}`}
563 onPointerDown={(event) => event.preventDefault()}
564 onClick={() => {
565 const preview = buildExpandedImagePreview(allImages, image.id);
566 if (preview) onExpandImage(preview);
567 }}
568 >
569 {image.previewUrl ? (
570 <ComposerImageThumbnail
571 file={image.file}
572 alt=""
573 className="size-full object-cover"
574 fallback={
575 isHeicImageFile({ name: image.name, type: image.mimeType }) ? (
576 <AttachmentImage
577 name={image.name}
578 mimeType={image.mimeType}
579 src={image.previewUrl}
580 alt=""
581 className="size-full object-cover"
582 />
583 ) : (
584 <PierreEntryIcon
585 pathValue={image.name}
586 kind="file"
587 theme={resolvedTheme}
588 className="m-auto size-3.5"
589 />
590 )
591 }
592 />
593 ) : (
594 <PierreEntryIcon
595 pathValue={image.name}
596 kind="file"
597 theme={resolvedTheme}
598 className="m-auto size-3.5"
599 />
600 )}
601 </button>
602 ))}
603 {counts.overflowCount > 0 ? (
604 <button
605 type="button"
606 className="flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md border border-border/70 bg-muted/60 font-medium text-secondary-label text-xs tabular-nums outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"
607 aria-label={`Show ${String(counts.overflowCount)} more image attachments`}
608 onPointerDown={(event) => event.preventDefault()}
609 onClick={onShowMore}
610 >
611 +{counts.overflowCount}
612 </button>
613 ) : null}
614 </div>
615 );
616}
617
618/** Attachments of the queued message being edited; they are already uploaded. */
619export function ComposerQueuedAttachmentRow({
620 attachments,
621 onRemove,
622}: {
623 readonly attachments: ReadonlyArray<{
624 readonly attachment: ChatAttachment;
625 readonly url: string | null;
626 }>;
627 readonly onRemove: (attachmentId: string) => void;
628}) {
629 return (
630 <div className="mb-3 flex flex-wrap gap-2">
631 {attachments.map(({ attachment, url }) => (
632 <div
633 key={attachment.id}
634 className="relative h-16 w-16 overflow-hidden rounded-lg border border-border/80 bg-background"
635 >
636 {attachment.type === "image" && url ? (
637 <img src={url} alt={attachment.name} className="h-full w-full object-cover" />
638 ) : (
639 <div className="flex h-full w-full items-center justify-center px-1 text-center text-3xs text-secondary-label">
640 {attachment.name}
641 </div>
642 )}
643 <Button
644 variant="media-close"
645 size="icon-xs"
646 className="absolute right-1 top-1"
647 onClick={() => onRemove(attachment.id)}
648 aria-label={`Remove ${attachment.name}`}
649 >
650 <XIcon />
651 </Button>
652 </div>
653 ))}
654 </div>
655 );
656}
657
658export function ComposerAttachButton({
659 addComposerAttachments,
660 focusComposer,
661}: {
662 readonly addComposerAttachments: (files: File[]) => Promise<boolean>;
663 readonly focusComposer: () => void;
664}) {
665 const inputRef = useRef<HTMLInputElement>(null);
666 return (
667 <>
668 <input
669 ref={inputRef}
670 type="file"
671 multiple
672 className="hidden"
673 onChange={(event) => {
674 const files = Array.from(event.currentTarget.files ?? []);
675 event.currentTarget.value = "";
676 // Inserting a chip refocuses the editor after the draft renders;
677 // focusing synchronously here would report the editor's stale text
678 // over the prompt that was just written.
679 void addComposerAttachments(files).then((inserted) => {
680 if (!inserted) focusComposer();
681 });
682 }}
683 />
684 <Tooltip>
685 <TooltipTrigger
686 render={
687 <Button
688 type="button"
689 variant="ghost"
690 size="icon-sm"
691 onPointerDown={(event) => event.preventDefault()}
692 onClick={() => inputRef.current?.click()}
693 aria-label="Attach files"
694 />
695 }
696 >
697 <PaperclipIcon />
698 </TooltipTrigger>
699 <TooltipPopup>Attach files</TooltipPopup>
700 </Tooltip>
701 </>
702 );
703}