Open History to see the last commit
1import { useCopyToClipboard } from "~/hooks/useCopyToClipboard";
2import { TRIAGE_CLI_COMMAND } from "~/hooks/useStartTriage";
3
4import { InlineButton } from "../ui/button";
5import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
6
7/**
8 * The empty-draft hero for a triage session, in place of "What should we work on?".
9 * Keeps the regular hero's heading-plus-one-line rhythm above the composer.
10 */
11export function TriageDraftHero(props: {
12 readonly machineLabel: string | null;
13 readonly serverVersion: string | null;
14}) {
15 const { copyToClipboard, isCopied } = useCopyToClipboard({ timeout: 1500, target: "command" });
16 return (
17 <div className="mx-auto flex w-full max-w-5xl flex-col items-center">
18 <h1 className="w-full text-center font-normal text-2xl text-foreground tracking-tight sm:text-3xl">
19 What went wrong?
20 </h1>
21 <p className="mt-2 flex h-6 w-full items-center justify-center gap-1.5 text-sm">
22 <Tooltip>
23 <TooltipTrigger
24 render={<span tabIndex={0} className="min-w-0 truncate font-medium text-foreground" />}
25 >
26 {props.machineLabel ?? "This machine"}
27 {props.serverVersion === null ? null : (
28 <span className="ml-1.5 font-normal text-muted-foreground">
29 v{props.serverVersion}
30 </span>
31 )}
32 </TooltipTrigger>
33 <TooltipPopup side="bottom">
34 The agent reads T3 Code's logs and source here, and asks before it applies a fix or
35 posts anything.
36 </TooltipPopup>
37 </Tooltip>
38 <span aria-hidden className="text-muted-foreground">
39 ·
40 </span>
41 <Tooltip>
42 <TooltipTrigger
43 render={
44 <InlineButton
45 tone="muted"
46 className="pointer-events-auto"
47 onClick={() => copyToClipboard(TRIAGE_CLI_COMMAND, undefined)}
48 />
49 }
50 >
51 {isCopied ? "Copied" : "or run"}
52 {isCopied ? null : <code className="ml-1 font-mono text-xs">{TRIAGE_CLI_COMMAND}</code>}
53 </TooltipTrigger>
54 <TooltipPopup side="bottom">Copy command, for a terminal</TooltipPopup>
55 </Tooltip>
56 </p>
57 </div>
58 );
59}