/** * @license * Copyright 2025 Qwen Team * SPDX-License-Identifier: Apache-2.0 */ import type React from 'react'; import type { ContextAttachment } from '../ContextAttachmentManager.js'; import './ContextPills.css'; interface ContextPillsProps { attachments: ContextAttachment[]; onRemove: (id: string) => void; } /** * Display attached context as pills/chips * Similar to ChatContextAttachments UI in vscode-copilot-chat */ export const ContextPills: React.FC = ({ attachments, onRemove, }) => { if (attachments.length === 0) { return null; } const getIcon = (type: string) => { switch (type) { case 'file': return ( ); case 'symbol': return ( ); case 'selection': return ( ); default: return ( ); } }; return (
{attachments.map((attachment) => (
{getIcon(attachment.type)}
{attachment.name}
))}
); };