+
+
{
+ setSearchFileVisibility(shareDBDoc, fileId, file.visibility === "open" ? "flattened" : "open");
+ }}
+ >
+
+
+
+ {
+ getExtensionIcon(file.name.split(".")[1])
+ }
+
{file.name}
+
+
+
+
{file.matches.length}
+
{
+ setSearchFileVisibility(shareDBDoc, fileId, "closed");
+ }}
+ >
+
+
+
+
+ {file.visibility != "flattened" &&
+ file.matches.map((match) => {
+ const before = match.text.substring(0, match.index);
+ const hit = match.text.substring(match.index, match.index + pattern.length);
+ const after = match.text.substring(match.index + pattern.length);
+
+ return (
+
{
+ setActiveFileId(fileId);
+ openTab({ fileId: fileId, isTransient: false });
+
+ if (editorCache.get(fileId)) {
+ jumpToPattern(editorCache.get(fileId).editor, pattern, match.line, match.index);
+ }
+ }}
+ >
+ {before}
+ {hit}
+ {after}
+
+ );
+ })
+ }
+