Open History to see the last commit
1import { scopeThreadRef } from "@t3tools/client-runtime/environment";
2import {
3 isAtomCommandInterrupted,
4 squashAtomCommandFailure,
5} from "@t3tools/client-runtime/state/runtime";
6import { deriveThreadQueueWorkflowState } from "@t3tools/client-runtime/state/thread-workflows";
7import {
8 assistantCitationsToPlainText,
9 collectAssistantCitations,
10} from "@t3tools/shared/assistantCitations";
11import { isSlashCommand } from "@t3tools/shared/composerTrigger";
12import {
13 isAttachmentOnlyBootstrapPrompt,
14 replaceComposerContextReferences,
15} from "@t3tools/shared/composerContextReferences";
16import { composerFileLinksToPlainText } from "@t3tools/shared/composerInlineTokens";
17import {
18 parseGoalCommand,
19 type ChatAttachment as ContractChatAttachment,
20 type EnvironmentId,
21 type MessageId,
22 type RunId,
23 type ThreadId,
24} from "@t3tools/contracts";
25import { resolveUserMessagePresentation } from "@t3tools/client-runtime/user-message";
26import { Link } from "@tanstack/react-router";
27import {
28 ArrowUpIcon,
29 CalendarClockIcon,
30 ChevronDownIcon,
31 Clock3Icon,
32 MessagesSquareIcon,
33 PencilIcon,
34 XIcon,
35} from "lucide-react";
36import * as DateTime from "effect/DateTime";
37import { msg, T, useGT, useMessages, plural, part } from "gt-react";
38import { thrownErrorMessage } from "@t3tools/client-runtime/errors";
39import { useId, useImperativeHandle, useRef, useState, type ReactNode, type Ref } from "react";
40
41import { useAssetUrls } from "../../assets/assetUrls";
42import { threadEnvironment } from "../../state/threads";
43import { useQuietThreadProjection, useQuietThreadShell } from "../../state/entities";
44import { useEnvironment } from "../../state/environments";
45import { useAtomCommand } from "../../state/use-atom-command";
46import { isImageAttachment, type ChatImageAttachment, type ChatMessage } from "../../types";
47import { cn } from "~/lib/utils";
48import { markdownProseDirection } from "~/textDirection";
49import { Button, InlineButton } from "../ui/button";
50import { toastManager } from "../ui/toast";
51import { m } from "../../i18n/messages";
52import { SharedTooltipTrigger } from "../ui/shared-tooltip";
53import type { TimestampFormat } from "@t3tools/contracts/settings";
54import { AssistantCitationChip } from "./AssistantCitationChip";
55import { GuestMessageName } from "./guestMessageStyle";
56import { TimelineRowTimestamp } from "./TimelineRowParts";
57import { FoldedMessageHeader, useScheduledTaskTitle } from "./TimelineUserMessageRow";
58import { buildExpandedImagePreview, type ExpandedImagePreview } from "./ExpandedImagePreview";
59
60export interface EditQueuedRunRequest {
61 readonly runId: RunId;
62 readonly messageId: MessageId;
63 readonly text: string;
64 readonly attachments: ReadonlyArray<ContractChatAttachment>;
65}
66
67// A longer queue shows its first messages and a button that shows the rest.
68const QUEUE_VISIBLE_ROWS = 3;
69
70export interface QueuedRunsControlHandle {
71 steerNext: (repeat: boolean) => boolean;
72 editLatest: (repeat: boolean) => boolean;
73}
74
75type ThreadQueueProjection = Parameters<typeof deriveThreadQueueWorkflowState>[0];
76
77function queuedImageResources(projection: ThreadQueueProjection | undefined) {
78 if (!projection) return [];
79 return deriveThreadQueueWorkflowState(projection).queuedRuns.flatMap(({ attachments }) =>
80 attachments.flatMap((attachment) =>
81 isImageAttachment(attachment)
82 ? [{ _tag: "attachment" as const, attachmentId: attachment.id }]
83 : [],
84 ),
85 );
86}
87
88export function QueuedRunsControl({
89 ref,
90 ...props
91}: {
92 readonly ref?: Ref<QueuedRunsControlHandle>;
93 readonly steerShortcutLabel?: string | null;
94 readonly editShortcutLabel?: string | null;
95 readonly environmentId: EnvironmentId;
96 readonly threadId: ThreadId;
97 readonly optimisticMessages: ReadonlyArray<
98 Pick<ChatMessage, "id" | "inputIntent" | "text" | "attachments">
99 >;
100 readonly editingRunId: RunId | null;
101 /** Set while something else holds the composer, such as an open question. */
102 readonly workspaceMissing?: boolean;
103 readonly editBlockedReason: string | null;
104 readonly onEditQueuedRun: (request: EditQueuedRunRequest) => void;
105 readonly onCancelEdit: () => void;
106 readonly timestampFormat: TimestampFormat;
107 readonly onOpenThread: (threadId: ThreadId, environmentId?: EnvironmentId) => void;
108 readonly onImageExpand: (preview: ExpandedImagePreview) => void;
109}) {
110 const gt = useGT();
111 const messages = useMessages();
112 const projection = useQuietThreadProjection(
113 scopeThreadRef(props.environmentId, props.threadId),
114 )?.projection;
115 const promote = useAtomCommand(threadEnvironment.promoteQueuedRun);
116 const resume = useAtomCommand(threadEnvironment.resumeThreadQueue);
117 const cancel = useAtomCommand(threadEnvironment.cancelQueuedRun);
118 const [showAll, setShowAll] = useState(false);
119 const queueListId = useId();
120 const [busyRunId, setBusyRunId] = useState<RunId | null>(null);
121 const steerInFlightRef = useRef(false);
122 // Run-only acknowledgements can resurrect pending rows after cancellation or startup.
123 const acknowledgedMessageIds = new Set((projection?.messages ?? []).map((message) => message.id));
124 const queuedImageAttachmentResources = queuedImageResources(projection);
125 const queuedImageAttachmentUrls = useAssetUrls(
126 props.environmentId,
127 queuedImageAttachmentResources,
128 );
129 const workflow = projection ? deriveThreadQueueWorkflowState(projection, messages) : null;
130 const queued = workflow?.queuedRuns ?? [];
131 const activeRun = workflow?.activeRun ?? null;
132 // A fresh message starts its own turn: it may skip compaction, but not steer into a turn.
133 const canSendRun = (freshContext: boolean, stopBlocksPromotion = false) =>
134 !props.workspaceMissing &&
135 (workflow?.canSendNow === true ||
136 (workflow?.canPromoteToSteer === true &&
137 !stopBlocksPromotion &&
138 (!freshContext || workflow.promoteSkipsCompaction === true)));
139 const queuedImageUrlById = new Map(
140 queuedImageAttachmentUrls.flatMap((url, index) => {
141 const resource = queuedImageAttachmentResources[index];
142 return url && resource ? [[resource.attachmentId, url] as const] : [];
143 }),
144 );
145 const optimisticQueued = props.optimisticMessages.filter(
146 (message) => message.inputIntent === "queued_turn" && !acknowledgedMessageIds.has(message.id),
147 );
148 const items = [
149 ...queued.map(({ run, text, attachments, context, message }, serverIndex) => ({
150 key: run.id,
151 message,
152 runId: run.id,
153 messageId: run.userMessageId,
154 freshContext: run.freshContext === true,
155 stopBlocksPromotion: queued[serverIndex]!.stopBlocksPromotion,
156 serverIndex,
157 text,
158 // A guest's message keeps the guest's words; the owner can cancel it, not rewrite it.
159 editable: context?.guest === undefined,
160 attachments,
161 thumbnails: attachments.filter(isImageAttachment).map<ChatImageAttachment>((attachment) => {
162 const previewUrl = queuedImageUrlById.get(attachment.id);
163 return {
164 ...attachment,
165 type: "image",
166 ...(previewUrl ? { previewUrl } : {}),
167 };
168 }),
169 pending: false,
170 })),
171 ...optimisticQueued.map((message) => ({
172 key: message.id,
173 message: undefined,
174 runId: null,
175 messageId: null,
176 freshContext: false,
177 stopBlocksPromotion: false,
178 serverIndex: null,
179 text: message.text,
180 editable: true,
181 attachments: [] as ReadonlyArray<ContractChatAttachment>,
182 thumbnails: (message.attachments ?? []).filter(isImageAttachment),
183 pending: true,
184 })),
185 ];
186
187 const sendQueuedMessage = async (queuedRunId: RunId) => {
188 const freshContext = queued.some(
189 ({ run }) => run.id === queuedRunId && run.freshContext === true,
190 );
191 if (!canSendRun(freshContext) || steerInFlightRef.current) return;
192 steerInFlightRef.current = true;
193 setBusyRunId(queuedRunId);
194 const result = workflow?.canSendNow
195 ? await resume({
196 environmentId: props.environmentId,
197 input: { threadId: props.threadId, runId: queuedRunId },
198 })
199 : activeRun !== null
200 ? await promote({
201 environmentId: props.environmentId,
202 input: { threadId: props.threadId, queuedRunId, targetRunId: activeRun.id },
203 })
204 : null;
205 steerInFlightRef.current = false;
206 setBusyRunId(null);
207 if (result?._tag === "Failure" && !isAtomCommandInterrupted(result)) {
208 const error = squashAtomCommandFailure(result);
209 toastManager.add({
210 type: "error",
211 title: m(msg("Could not send queued message")),
212 description:
213 error instanceof Error
214 ? (thrownErrorMessage(error, m) ?? error.message)
215 : m(msg("An error occurred.")),
216 });
217 }
218 };
219
220 useImperativeHandle(ref, () => ({
221 steerNext(repeat) {
222 const next = queued[0];
223 if (!next || !canSendRun(next.run.freshContext === true)) return false;
224 // Keep the chord while Stop settles, or the composer takes it as a line break.
225 if (!canSendRun(next.run.freshContext === true, next.stopBlocksPromotion)) return true;
226 if (!repeat && busyRunId === null) void sendQueuedMessage(next.run.id);
227 return true;
228 },
229 // Leave the key to caret navigation while editing.
230 editLatest(repeat) {
231 const latest = queued.at(-1);
232 if (
233 !latest ||
234 latest.context?.guest !== undefined ||
235 props.editingRunId !== null ||
236 props.editBlockedReason !== null ||
237 busyRunId !== null
238 ) {
239 return false;
240 }
241 if (!repeat) {
242 setShowAll(true);
243 props.onEditQueuedRun({
244 runId: latest.run.id,
245 messageId: latest.run.userMessageId,
246 text: latest.text,
247 attachments: latest.attachments,
248 });
249 }
250 return true;
251 },
252 }));
253
254 if (items.length === 0) return null;
255
256 const remove = async (runId: RunId) => {
257 setBusyRunId(runId);
258 await cancel({
259 environmentId: props.environmentId,
260 input: { threadId: props.threadId, runId },
261 });
262 setBusyRunId(null);
263 };
264
265 const collapsible = items.length > QUEUE_VISIBLE_ROWS;
266 const visibleItems = collapsible && !showAll ? items.slice(0, QUEUE_VISIBLE_ROWS - 1) : items;
267
268 return (
269 <section
270 aria-label={gt`${plural(
271 { count: items.length },
272 {
273 one: part`${{ count: items.length }} queued message`,
274 other: part`${{ count: items.length }} queued messages`,
275 },
276 )}`}
277 data-thread-queue="true"
278 // Anchors the sr-only live region; unanchored, it escapes the timeline scroller and makes the chat column scroll.
279 className="relative mx-auto flex w-full max-w-(--chat-content-max-width) flex-col gap-2 pb-4"
280 >
281 <span className="sr-only" aria-live="polite">
282 {gt`${plural(
283 { count: items.length },
284 {
285 one: part`${{ count: items.length }} queued`,
286 other: part`${{ count: items.length }} queued`,
287 },
288 )}`}
289 </span>
290 <ol className="flex flex-col items-end gap-3" id={queueListId}>
291 {visibleItems.map((item, position) => {
292 const previewText = isAttachmentOnlyBootstrapPrompt(item.text)
293 ? ""
294 : composerFileLinksToPlainText(
295 replaceComposerContextReferences(item.text, (reference) => reference.label),
296 ).trim();
297 const isEditing = item.runId !== null && item.runId === props.editingRunId;
298 // The server decides on the agent's text, and a goal command can stop the turn.
299 const sentText = { text: item.message?.text ?? item.text, attachments: item.attachments };
300 const movesCommandFirst = isSlashCommand(sentText) && parseGoalCommand(sentText) === null;
301 return (
302 <li
303 key={item.key}
304 aria-label={gt`Queued message ${{ position: position + 1 }} of ${{ total: items.length }}, not sent`}
305 aria-posinset={position + 1}
306 aria-setsize={items.length}
307 aria-current={isEditing ? "true" : undefined}
308 className="group/queued flex w-full flex-col items-end gap-1"
309 >
310 <QueuedMessage
311 environmentId={props.environmentId}
312 message={item.message}
313 previewText={previewText}
314 thumbnails={item.thumbnails}
315 isEditing={isEditing}
316 timestampFormat={props.timestampFormat}
317 onOpenThread={props.onOpenThread}
318 onImageExpand={props.onImageExpand}
319 >
320 {canSendRun(item.freshContext, item.stopBlocksPromotion) && !isEditing ? (
321 <>
322 <SharedTooltipTrigger
323 render={<span className="flex shrink-0" />}
324 label={
325 item.serverIndex === 0 && props.steerShortcutLabel
326 ? workflow?.canSendNow
327 ? gt`Start a turn with this message (${{ shortcut: props.steerShortcutLabel }})`
328 : workflow?.promoteSkipsCompaction
329 ? gt`Skip compaction and send this message (${{ shortcut: props.steerShortcutLabel }})`
330 : movesCommandFirst
331 ? gt`Move this command to the front of the queue (${{ shortcut: props.steerShortcutLabel }})`
332 : gt`Send into the current turn (${{ shortcut: props.steerShortcutLabel }})`
333 : workflow?.canSendNow
334 ? gt`Start a turn with this message`
335 : workflow?.promoteSkipsCompaction
336 ? gt`Skip compaction and send this message`
337 : movesCommandFirst
338 ? gt`Move this command to the front of the queue`
339 : gt`Send into the current turn`
340 }
341 >
342 <Button
343 size="xs"
344 variant="ghost-muted"
345 disabled={item.runId === null || busyRunId !== null}
346 onClick={() => {
347 if (item.runId !== null) {
348 void sendQueuedMessage(item.runId);
349 }
350 }}
351 >
352 <ArrowUpIcon />
353 <T>Send now</T>
354 </Button>
355 </SharedTooltipTrigger>
356 </>
357 ) : null}
358 {item.pending ? (
359 <span className="flex items-center gap-1 px-1">
360 <Clock3Icon aria-hidden className="size-3" />
361 <T>Saving</T>
362 </span>
363 ) : null}
364 {isEditing ? (
365 <>
366 <span className="px-1 text-foreground">
367 <T>Editing in the composer</T>
368 </span>
369 <Button
370 size="xs"
371 variant="ghost"
372 aria-label={gt`Cancel editing queued message`}
373 onClick={props.onCancelEdit}
374 >
375 <T>Cancel</T>
376 </Button>
377 </>
378 ) : (
379 <>
380 {/* The span keeps the tooltip, and its reason, on a disabled button. */}
381 <SharedTooltipTrigger
382 render={<span className="flex shrink-0" />}
383 label={
384 props.editBlockedReason ??
385 (item.serverIndex === queued.length - 1 && props.editShortcutLabel
386 ? gt`Edit in the composer (${{ shortcut: props.editShortcutLabel }})`
387 : gt`Edit in the composer`)
388 }
389 >
390 <Button
391 size="icon-xs"
392 variant="ghost-muted"
393 aria-label={gt`Edit queued message`}
394 disabled={
395 item.runId === null ||
396 !item.editable ||
397 busyRunId !== null ||
398 props.editBlockedReason !== null
399 }
400 onClick={() => {
401 if (item.runId !== null && item.messageId !== null) {
402 props.onEditQueuedRun({
403 runId: item.runId,
404 messageId: item.messageId,
405 text: item.text,
406 attachments: item.attachments,
407 });
408 }
409 }}
410 >
411 <PencilIcon />
412 </Button>
413 </SharedTooltipTrigger>
414 <SharedTooltipTrigger
415 render={
416 <Button
417 size="icon-xs"
418 variant="ghost-muted"
419 aria-label={gt`Remove queued message`}
420 disabled={item.runId === null || busyRunId !== null}
421 onClick={() => {
422 if (item.runId !== null) void remove(item.runId);
423 }}
424 />
425 }
426 label={
427 <>
428 <T>Remove from queue</T>
429 </>
430 }
431 >
432 <XIcon />
433 </SharedTooltipTrigger>
434 </>
435 )}
436 </QueuedMessage>
437 </li>
438 );
439 })}
440 </ol>
441 {collapsible ? (
442 <div className="self-end pe-1 text-xs pointer-coarse:[&_[data-slot=inline-button]]:relative pointer-coarse:[&_[data-slot=inline-button]]:after:absolute pointer-coarse:[&_[data-slot=inline-button]]:after:-inset-x-1.5 pointer-coarse:[&_[data-slot=inline-button]]:after:-inset-y-3.5">
443 <InlineButton
444 tone="muted"
445 aria-expanded={showAll}
446 aria-controls={queueListId}
447 // Keep the composer focused; keyboard activation still works.
448 onPointerDown={(event) => event.preventDefault()}
449 onClick={() => setShowAll((value) => !value)}
450 >
451 {showAll
452 ? gt`Show fewer`
453 : gt`${plural(
454 { count: items.length },
455 {
456 one: part`Show all ${{ count: items.length }} queued`,
457 other: part`Show all ${{ count: items.length }} queued`,
458 },
459 )}`}
460 <ChevronDownIcon
461 aria-hidden
462 className={cn(
463 "size-3.5 transition-transform duration-150 motion-reduce:transition-none",
464 showAll && "rotate-180",
465 )}
466 />
467 </InlineButton>
468 </div>
469 ) : null}
470 </section>
471 );
472}
473
474type QueuedRunMessage = NonNullable<ThreadQueueProjection["messages"][number]>;
475
476function QueuedMessageText({ text }: { readonly text: string }) {
477 const parts: ReactNode[] = [];
478 let cursor = 0;
479 for (const { citation, start, end } of collectAssistantCitations(text)) {
480 parts.push(
481 text.slice(cursor, start),
482 <AssistantCitationChip key={start} citation={citation} />,
483 );
484 cursor = end;
485 }
486 parts.push(text.slice(cursor));
487 const prose = parts.filter((part) => typeof part === "string").join(" ");
488 return (
489 <p className="whitespace-pre-wrap wrap-anywhere" dir={markdownProseDirection(prose)}>
490 {parts}
491 </p>
492 );
493}
494
495/** A queued turn wears its sent form's attribution; only the dashed edge and controls differ. */
496function QueuedMessage(props: {
497 readonly environmentId: EnvironmentId;
498 readonly message: QueuedRunMessage | undefined;
499 readonly previewText: string;
500 readonly thumbnails: ReadonlyArray<ChatImageAttachment>;
501 readonly isEditing: boolean;
502 readonly timestampFormat: TimestampFormat;
503 readonly onOpenThread: (threadId: ThreadId, environmentId?: EnvironmentId) => void;
504 readonly children: ReactNode;
505 readonly onImageExpand: (preview: ExpandedImagePreview) => void;
506}) {
507 const gt = useGT();
508 const presentation = props.message ? resolveUserMessagePresentation(props.message) : null;
509 const attribution = presentation?.attribution ?? null;
510 const scheduledTaskId = presentation?.scheduledTaskId;
511 const senderThreadId = props.message?.senderThreadId;
512 // A linked environment's agent sent it from a thread there.
513 const senderRef =
514 props.message?.linkedSender ??
515 (senderThreadId === undefined ? null : scopeThreadRef(props.environmentId, senderThreadId));
516 const [expanded, setExpanded] = useState(false);
517 const taskTitle = useScheduledTaskTitle(props.environmentId, scheduledTaskId);
518 const senderShell = useQuietThreadShell(attribution === "agent" ? senderRef : null);
519 const linkedSenderEnvironment = useEnvironment(
520 props.message?.linkedSender?.environmentId ?? null,
521 );
522 const senderTitle = senderShell?.title.trim() || props.message?.linkedSender?.title.trim();
523 const summaryText =
524 attribution === "automation" || attribution === "agent"
525 ? assistantCitationsToPlainText(props.previewText).trim()
526 : "";
527 const fold =
528 attribution === "automation"
529 ? {
530 icon: CalendarClockIcon,
531 label: gt`Automation`,
532 fitLabel: true,
533 summary: taskTitle ?? summaryText.split(/\r?\n/, 1)[0] ?? "",
534 }
535 : attribution === "agent"
536 ? {
537 icon: MessagesSquareIcon,
538 label:
539 senderTitle ||
540 gt({ context: "fallback name of the agent that sent a message" })`Agent`,
541 fitLabel: !senderTitle,
542 summary: summaryText.split(/\r?\n/).find((line) => line.trim()) ?? "",
543 }
544 : null;
545 const bodyVisible = fold === null || expanded;
546
547 return (
548 <>
549 {attribution === "t3code" ? (
550 <p className="me-1 text-2xs text-muted-foreground/70">
551 <T>Sent by T3 Code</T>
552 </p>
553 ) : null}
554 {presentation?.guestName === undefined ? null : (
555 <GuestMessageName name={presentation.guestName} />
556 )}
557 {/* Dashed and unfilled: a turn that has not been sent yet. */}
558 <div
559 className={cn(
560 "flex min-w-0 max-w-[80%] flex-col rounded-2xl border border-dashed text-sm",
561 props.isEditing
562 ? "border-primary/60 text-foreground"
563 : attribution === "guest"
564 ? "border-guest/50 text-muted-foreground"
565 : "border-muted-foreground/40 text-muted-foreground",
566 fold === null && "px-3 py-2",
567 fold !== null && expanded && "w-full",
568 )}
569 >
570 {fold ? (
571 <FoldedMessageHeader
572 icon={fold.icon}
573 label={fold.label}
574 fitLabel={fold.fitLabel}
575 summary={fold.summary}
576 expanded={expanded}
577 onToggle={() => setExpanded((value) => !value)}
578 />
579 ) : null}
580 {bodyVisible ? (
581 <div
582 className={cn(
583 "flex flex-col gap-2",
584 fold !== null && "max-h-96 overflow-auto px-3 pb-2",
585 )}
586 >
587 {props.thumbnails.length > 0 ? (
588 <span className="flex flex-wrap items-center gap-1">
589 {props.thumbnails.map((thumbnail) => (
590 <button
591 key={thumbnail.id}
592 type="button"
593 aria-label={gt`Preview ${{ name: thumbnail.name }}`}
594 disabled={!thumbnail.previewUrl}
595 className="size-8 overflow-hidden rounded-md border border-border/70 bg-background enabled:cursor-zoom-in"
596 onPointerDown={(event) => event.preventDefault()}
597 onClick={() => {
598 const preview = buildExpandedImagePreview(props.thumbnails, thumbnail.id);
599 if (preview) props.onImageExpand(preview);
600 }}
601 >
602 {thumbnail.previewUrl ? (
603 <img
604 src={thumbnail.previewUrl}
605 alt={thumbnail.name}
606 className="size-full object-cover"
607 />
608 ) : (
609 <span aria-label={thumbnail.name} className="block size-full bg-muted/60" />
610 )}
611 </button>
612 ))}
613 </span>
614 ) : null}
615 {/* In full, like a sent turn: a queued message is read before it is sent. */}
616 {props.previewText ? <QueuedMessageText text={props.previewText} /> : null}
617 </div>
618 ) : null}
619 </div>
620 <div className="flex items-center gap-0.5 pe-1 text-xs text-muted-foreground">
621 {props.message ? (
622 <span className="me-1 flex items-center gap-2 px-1 opacity-0 transition-opacity duration-200 pointer-coarse:opacity-100 focus-within:opacity-100 group-hover/queued:opacity-100">
623 {attribution === "agent" &&
624 senderRef &&
625 // Only an environment this client is connected to can open the sender's thread there.
626 (props.message?.linkedSender === undefined || linkedSenderEnvironment !== null) ? (
627 <InlineButton
628 tone="muted"
629 onClick={() => props.onOpenThread(senderRef.threadId, senderRef.environmentId)}
630 >
631 <T>Open thread</T>
632 </InlineButton>
633 ) : null}
634 {scheduledTaskId ? (
635 <InlineButton
636 tone="muted"
637 render={
638 <Link
639 to="/settings/scheduled-tasks"
640 search={{ environmentId: props.environmentId, taskId: scheduledTaskId }}
641 />
642 }
643 >
644 <T>Open automation</T>
645 </InlineButton>
646 ) : null}
647 <TimelineRowTimestamp
648 createdAt={DateTime.formatIso(props.message.createdAt)}
649 timestampFormat={props.timestampFormat}
650 alwaysVisible
651 />
652 </span>
653 ) : null}
654 {props.children}
655 </div>
656 </>
657 );
658}