MCPcopy Create free account
hub / github.com/codeaashu/claude-code / ToolGlob

Function ToolGlob

web/components/tools/ToolGlob.tsx:25–88  ·  view source on GitHub ↗
({
  input,
  result,
  isError = false,
  isRunning = false,
  startedAt,
  completedAt,
}: ToolGlobProps)

Source from the content-addressed store, hash-verified

23}
24
25export function ToolGlob({
26 input,
27 result,
28 isError = false,
29 isRunning = false,
30 startedAt,
31 completedAt,
32}: ToolGlobProps) {
33 const files = result ? parseFilePaths(result) : [];
34 const fileCount = files.length;
35
36 return (
37 <ToolUseBlock
38 toolName="glob"
39 toolInput={input}
40 toolResult={result}
41 isError={isError}
42 isRunning={isRunning}
43 startedAt={startedAt}
44 completedAt={completedAt}
45 >
46 {/* Pattern header */}
47 <div className="flex items-center gap-2 px-3 py-2 bg-surface-850 border-b border-surface-700/50">
48 <code className="font-mono text-xs text-brand-300">{input.pattern}</code>
49 {input.path && (
50 <span className="text-xs text-surface-500">in {input.path}</span>
51 )}
52 {!isRunning && fileCount > 0 && (
53 <span className="ml-auto text-xs text-surface-500">
54 {fileCount} match{fileCount !== 1 ? "es" : ""}
55 </span>
56 )}
57 </div>
58
59 {/* File list */}
60 {isRunning ? (
61 <div className="px-3 py-4 text-surface-500 text-xs animate-pulse">
62 Searching…
63 </div>
64 ) : isError ? (
65 <div className="px-3 py-3 text-red-400 text-xs font-mono">{result}</div>
66 ) : files.length === 0 ? (
67 <div className="px-3 py-3 text-surface-500 text-xs">No matches found.</div>
68 ) : (
69 <div className="overflow-auto max-h-[320px] py-1">
70 {files.map((filePath, i) => (
71 <div
72 key={i}
73 className="flex items-center gap-2 px-3 py-1 hover:bg-surface-800/50 transition-colors"
74 >
75 <FileIcon
76 filePath={filePath}
77 className="w-3.5 h-3.5 text-surface-400 flex-shrink-0"
78 />
79 <span className="font-mono text-xs text-surface-200 truncate">
80 {filePath}
81 </span>
82 </div>

Callers

nothing calls this directly

Calls 1

parseFilePathsFunction · 0.85

Tested by

no test coverage detected