"use client";
import type { FC } from "react";
import { cn } from "@/lib/utils";
import { ReasoningItem, ToolCallItem } from "./items";
import type { ItemStatus, TimelineGroup, TimelineItem } from "./types";
function renderItem(item: TimelineItem) {
if (item.kind === "reasoning") return ;
return ;
}
/**
* Single group row in the timeline tree: status dot + connector line in
* the gutter, parent item content + indented children in the body.
*
* The connector line overshoots by ~15px to land on the next group's
* dot center; the line passes BEHIND any indented children (whose
* column has no dot of its own) for a clean tree look.
*/
export const TimelineGroupRow: FC<{
group: TimelineGroup;
parentStatus: ItemStatus;
showParentLine: boolean;
}> = ({ group, parentStatus, showParentLine }) => {
const hasChildren = group.children.length > 0;
return (
{showParentLine && (
)}
{parentStatus === "running" ? (
) : (
)}
{renderItem(group.parent)}
{hasChildren && (
{group.children.map((child) => (
{renderItem(child)}
))}
)}
);
};