feat(vscode-ide-companion): 新增共享 UI 组件 FileLink

- 新增 FileLink 组件用于显示文件链接
- 更新 LayoutComponents 增加通用布局组件
- 新增 utils.ts 提供工具函数

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
yiliang114
2025-11-21 01:51:50 +08:00
parent 9ba99177b9
commit 1eedd36542
4 changed files with 299 additions and 9 deletions

View File

@@ -7,6 +7,7 @@
*/
import type React from 'react';
import { FileLink } from '../../shared/FileLink.js';
/**
* Props for ToolCallCard wrapper
@@ -20,11 +21,11 @@ interface ToolCallCardProps {
* Main card wrapper with icon
*/
export const ToolCallCard: React.FC<ToolCallCardProps> = ({
icon,
icon: _icon,
children,
}) => (
<div className="tool-call-card">
<div className="tool-call-icon">{icon}</div>
{/* <div className="tool-call-icon">{icon}</div> */}
<div className="tool-call-grid">{children}</div>
</div>
);
@@ -95,15 +96,12 @@ interface LocationsListProps {
}
/**
* List of file locations
* List of file locations with clickable links
*/
export const LocationsList: React.FC<LocationsListProps> = ({ locations }) => (
<>
<div className="locations-list">
{locations.map((loc, idx) => (
<div key={idx}>
{loc.path}
{loc.line !== null && loc.line !== undefined && `:${loc.line}`}
</div>
<FileLink key={idx} path={loc.path} line={loc.line} showFullPath={true} />
))}
</>
</div>
);