-
Notifications
You must be signed in to change notification settings - Fork 307
Expand file tree
/
Copy pathgetDiffToolComponent.tsx
More file actions
30 lines (27 loc) · 1.27 KB
/
Copy pathgetDiffToolComponent.tsx
File metadata and controls
30 lines (27 loc) · 1.27 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
'use client';
import { Separator } from '@/components/ui/separator';
import { GetDiffMetadata, ToolResult } from '@/features/tools';
export const GetDiffToolComponent = ({ metadata }: ToolResult<GetDiffMetadata>) => {
const fileCount = metadata.files.length;
return (
<div className="flex items-center gap-2 select-none cursor-default text-sm text-muted-foreground">
<span className="flex-shrink-0">Compared</span>
<span className="text-xs font-mono bg-muted px-1.5 py-0.5 rounded text-foreground">
{metadata.base}
</span>
<span className="flex-shrink-0">to</span>
<span className="text-xs font-mono bg-muted px-1.5 py-0.5 rounded text-foreground">
{metadata.head}
</span>
<span className="flex-shrink-0">in</span>
<span className="text-xs font-mono bg-muted px-1.5 py-0.5 rounded text-foreground truncate">
{metadata.repo}
</span>
<span className="flex-1" />
<span className="text-xs flex-shrink-0">
{fileCount} changed {fileCount === 1 ? 'file' : 'files'}
</span>
<Separator orientation="vertical" className="h-3 flex-shrink-0" />
</div>
);
};