MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / ToolSearchFiles

Function ToolSearchFiles

dashboard/lcm/src/components.tsx:286–312  ·  view source on GitHub ↗
(props: { data: any })

Source from the content-addressed store, hash-verified

284}
285
286function ToolSearchFiles(props: { data: any }): React.ReactElement {
287 const d = props.data;
288 const matches = d.matches || [];
289 return (
290 <div className="hermes-lcm-tool">
291 <div className="hermes-lcm-tool-meta">
292 {toolBadge(fmtInt(d.total_count != null ? d.total_count : matches.length) + " matches")}
293 </div>
294 <div className="hermes-lcm-tool-matches">
295 {matches.slice(0, 50).map(function (mm: any, i: number) {
296 return (
297 <div key={i} className="hermes-lcm-tool-match">
298 <div className="hermes-lcm-tool-match-loc">
299 <span className="hermes-lcm-tool-path">{short(String(mm.path || ""), 72)}</span>
300 {mm.line != null ? <span className="hermes-lcm-dim">{":" + mm.line}</span> : null}
301 </div>
302 {mm.content != null
303 ? <code className="hermes-lcm-tool-match-code">{short(String(mm.content), 220)}</code>
304 : null}
305 </div>
306 );
307 })}
308 </div>
309 {matches.length > 50 ? <div className="hermes-lcm-dim">{"+" + fmtInt(matches.length - 50) + " more"}</div> : null}
310 </div>
311 );
312}
313
314const TODO_ICON: Record<string, string> = { completed: "✓", in_progress: "◐", pending: "○", cancelled: "✗" };
315

Callers

nothing calls this directly

Calls 3

fmtIntFunction · 0.90
shortFunction · 0.90
toolBadgeFunction · 0.85

Tested by

no test coverage detected