This repository was archived by the owner on May 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy pathTaskItemFooter.tsx
More file actions
81 lines (75 loc) · 2.43 KB
/
Copy pathTaskItemFooter.tsx
File metadata and controls
81 lines (75 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import React from "react"
import type { HistoryItem } from "@roo-code/types"
import { formatTimeAgo } from "@/utils/format"
import { CopyButton } from "./CopyButton"
import { ExportButton } from "./ExportButton"
import { DeleteButton } from "./DeleteButton"
import { StandardTooltip } from "../ui/standard-tooltip"
import { useAppTranslation } from "@/i18n/TranslationContext"
import { Split, Layers, AlertTriangle } from "lucide-react"
export interface TaskItemFooterProps {
item: HistoryItem
variant: "compact" | "full"
isSelectionMode?: boolean
isSubtask?: boolean
onDelete?: (taskId: string) => void
}
const TaskItemFooter: React.FC<TaskItemFooterProps> = ({
item,
variant,
isSelectionMode = false,
isSubtask = false,
onDelete,
}) => {
const { t } = useAppTranslation()
return (
<div className="text-xs text-vscode-descriptionForeground flex justify-between items-center">
<div className="flex gap-1 items-center text-vscode-descriptionForeground/60">
{/* Background task tag */}
{item.background && (
<>
{item.status === "interrupted" ? (
<AlertTriangle className="size-3 text-vscode-editorWarning-foreground" />
) : (
<Layers className="size-3" />
)}
<span>
{item.status === "interrupted" ? t("history:interruptedTag") : t("history:backgroundTag")}
</span>
<span>·</span>
</>
)}
{/* Subtask tag */}
{isSubtask && (
<>
<Split className="size-3" />
<span>{t("history:subtaskTag")}</span>
<span>·</span>
</>
)}
{/* Datetime with time-ago format */}
<StandardTooltip content={new Date(item.ts).toLocaleString()}>
<span className="first-letter:uppercase">{formatTimeAgo(item.ts)}</span>
</StandardTooltip>
{/* Cost */}
{!!item.totalCost && (
<>
<span>·</span>
<span className="flex items-center" data-testid="cost-footer-compact">
{"$" + item.totalCost.toFixed(2)}
</span>
</>
)}
</div>
{/* Action Buttons for non-compact view */}
{!isSelectionMode && (
<div className="flex flex-row gap-0 -mx-1.5 items-center text-vscode-descriptionForeground/60 hover:text-vscode-descriptionForeground opacity-0 group-hover:opacity-100">
<CopyButton itemTask={item.task} />
{variant === "full" && <ExportButton itemId={item.id} />}
{onDelete && <DeleteButton itemId={item.id} onDelete={onDelete} />}
</div>
)}
</div>
)
}
export default TaskItemFooter