Open History to see the last commit
1import type { LucideIcon } from "lucide-react";
2
3import { cn } from "~/lib/utils";
4
5export function TimelineSystemDivider(props: {
6 readonly label: string;
7 readonly detail?: string | null;
8 readonly tone?: "neutral" | "danger";
9 readonly icon?: LucideIcon;
10 readonly actionLabel?: string;
11 readonly onAction?: () => void;
12}) {
13 const Icon = props.icon;
14 const content = (
15 <>
16 {Icon ? <Icon className="size-3 shrink-0" /> : null}
17 <span className="font-medium">{props.label}</span>
18 {props.detail ? <span className="max-w-80 truncate opacity-70">· {props.detail}</span> : null}
19 </>
20 );
21
22 return (
23 <div
24 className={cn(
25 "flex min-w-0 items-center gap-2 py-2 text-[11px] text-muted-foreground",
26 props.tone === "danger" && "text-destructive",
27 )}
28 >
29 <span aria-hidden="true" className="h-px flex-1 bg-border/70" />
30 {props.onAction ? (
31 <button
32 type="button"
33 aria-label={props.actionLabel}
34 onClick={props.onAction}
35 className="flex min-w-0 items-center gap-1.5 rounded-full border border-border/70 bg-background px-2.5 py-1 transition-colors hover:bg-muted"
36 title={props.actionLabel}
37 >
38 {content}
39 </button>
40 ) : (
41 <span className="flex min-w-0 items-center gap-1.5 rounded-full px-2 py-1">{content}</span>
42 )}
43 <span aria-hidden="true" className="h-px flex-1 bg-border/70" />
44 </div>
45 );
46}