Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
import { withTimeFormat } from "@/lib/time-format";
import { ActionBarMorePrimitive, useAuiState } from "@assistant-ui/react";
import { InformationCircleIcon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { useLocale, useT } from "@/i18n";
import { formatMessageDate } from "@/lib/format-message-date";
import { messageTimestamp } from "@/lib/message-timestamp";
import type { FC } from "react";
/** The menu renders only while open, so no timer. */
export const MessageMenuTime: FC<{ onShowDetails: () => void }> = ({
onShowDetails,
}) => {
const t = useT();
const locale = useLocale();
const createdAt = useAuiState(({ message }) => messageTimestamp(message));
const date =
createdAt !== undefined && Number.isFinite(createdAt)
? new Date(createdAt)
: null;
return (
<Tooltip>
<TooltipTrigger asChild={true}>
<ActionBarMorePrimitive.Item
onSelect={onShowDetails}
aria-label="See response details"
className="group/menu-time flex w-fit max-w-full cursor-pointer items-center rounded-md text-muted-foreground outline-none"
>
{date && (
<time
dateTime={date.toISOString()}
className="block select-none py-2 pl-3 pr-1 text-sm tabular-nums transition-colors group-hover/menu-time:text-foreground group-focus/menu-time:text-foreground"
>
{formatMessageDate(date.getTime(), Date.now(), locale, {
today: (time) => t("common.todayAt", { time }),
yesterday: (time) => t("common.yesterdayAt", { time }),
})}
</time>
)}
{/* Right after the time. Shown while this row is hovered, or when reached by keyboard.
Visibility, not an opacity fade: the fade's compositing layer, clipped by the menu's
rounded scroller, was left on screen in the desktop app's WebKit after the pointer left. */}
<span className="invisible flex size-7 shrink-0 items-center justify-center rounded-full group-hover/menu-time:visible group-hover/menu-time:bg-accent group-hover/menu-time:text-accent-foreground group-focus/menu-time:visible group-focus/menu-time:bg-accent group-focus/menu-time:text-accent-foreground">
<HugeiconsIcon icon={InformationCircleIcon} strokeWidth={1.75} className="size-icon" />
</span>
</ActionBarMorePrimitive.Item>
</TooltipTrigger>
<TooltipContent side="top" className="tooltip-compact">
{date
? `${date.toLocaleString(
locale,
withTimeFormat({ dateStyle: "full", timeStyle: "short" }, locale),
)} · See response details`
: "See response details"}
</TooltipContent>
</Tooltip>
);
};