export type ToolIconKind = 'search' | 'terminal' | 'file' | 'edit' | 'browser' | 'issue' | 'plug' | 'spark';

export function iconKindForTool(toolName: string | null | undefined): ToolIconKind {
  const name = (toolName ?? '').toLowerCase();
  if (!name) return 'spark';
  if (name === 'websearch' || name === 'webfetch') return 'search';
  if (name === 'bash') return 'terminal';
  if (name === 'read' || name === 'glob' || name === 'grep') return 'file';
  if (name === 'write' || name === 'edit') return 'edit';
  if (name === 'browseweb') return 'browser';
  if (name.startsWith('mcp__gitea') || name.includes('__issue')) return 'issue';
  if (name.startsWith('mcp__')) return 'plug';
  return 'spark';
}
