Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

ThreadStatusLine.tsx

27 lines889 Bytes

1import type { ReactNode } from "react";
2​
3import { InlineButton } from "../ui/button";
4​
5export function ThreadStatusLine(props: {
6 readonly icon: ReactNode;
7 readonly label: string;
8 readonly actionLabel: string;
9 readonly actionDisabled?: boolean;
10 readonly onAction: () => void;
11 // Set for clock-dependent labels to trigger updates.
12 readonly clockMinute?: string;
13}) {
14 return (
15 <div
16 data-chat-thread-status-line="true"
17 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"
18 >
19 {props.icon}
20 <span className="min-w-0 truncate">{props.label}</span>
21 <span aria-hidden="true">·</span>
22 <InlineButton disabled={props.actionDisabled} onClick={props.onAction}>
23 {props.actionLabel}
24 </InlineButton>
25 </div>
26 );