Open History to see the last commit
1import type { ReactNode } from "react";
2
3import { useClientSettings } from "~/hooks/useSettings";
4import { InlineButton } from "../ui/button";
5
6export function ThreadStatusLine(props: {
7 readonly icon: ReactNode;
8 readonly label: string;
9 readonly actionLabel: string;
10 readonly actionDisabled?: boolean;
11 readonly onAction: () => void;
12 // Set for clock-dependent labels to trigger updates.
13 readonly clockMinute?: string;
14}) {
15 // Muted, the action blends into the status text; the New design gives it full color.
16 const redesign = useClientSettings((s) => s.redesignEnabled);
17 return (
18 <div
19 data-chat-thread-status-line="true"
20 className="mx-auto flex w-full min-w-0 max-w-(--chat-content-max-width) items-center gap-1.5 px-1 pb-2 text-muted-foreground text-xs [&_svg]:size-3.5 [&_svg]:shrink-0"
21 >
22 {props.icon}
23 <span className="min-w-0 truncate">{props.label}</span>
24 <span aria-hidden="true">·</span>
25 <InlineButton
26 tone={redesign ? "default" : "muted"}
27 disabled={props.actionDisabled}
28 onClick={props.onAction}
29 >
30 {props.actionLabel}
31 </InlineButton>
32 </div>
33 );
34}