!isSearching && onDropzoneOver(e)}
ondragleave={(e) => !isSearching && onDropzoneLeave(e)}
ondrop={(e) => !isSearching && onDropzoneDrop(e)}
>
{#each breadcrumbs() as seg, i}
{#if i > 0}/{/if}
{#if i === breadcrumbs().length - 1}
onBreadcrumbDragOver(e, seg.path)}
ondragleave={onBreadcrumbDragLeave}
ondrop={(e) => onBreadcrumbDrop(e, seg.path)}>{seg.name}
{:else}
{/if}
{/each}
{#if !isSearching}
{/if}
!isSearching && onDirectoryContextMenu(e)}
>
{#if showNewInput && !isSearching}
{
if (e.key === 'Enter') confirmNew();
if (e.key === 'Escape') cancelNew();
}}
autofocus
/>
{/if}
{#if loading && initialLoad}
{:else if error}
{error}
{:else if isSearching}
{#if matchLoading}
{:else if matchError}
{:else if !matchResults?.length}
{:else}
{#snippet resultRows(matches: FileMatch[])}
{#each matches as match (match.path)}
{#if match.content_matches.length > 0}
{@const preview = match.content_matches[0]}
{/if}
{/each}
{/snippet}
{#if filenameMatches.length > 0}
{$t('files.filenameMatches')}
{@render resultRows(filenameMatches)}
{/if}
{#if contentOnlyMatches.length > 0}
{$t('files.contentMatches')}
{@render resultRows(contentOnlyMatches)}
{/if}
{#if nextMatchOffset !== null}
{#if matchLoadingMore}
{:else if matchLoadMoreError}
{/if}
{/if}
{/if}
{:else if visibleEntries.length === 0 && !showNewInput}
{searchQuery ? $t('files.noMatches') : $t('files.emptyDirectory')}
{:else}
{#each visibleEntries as entry, i (entry.path)}
{#if renamingEntry === entry.path}
{
if (e.key === 'Enter') confirmRename(entry.path);
if (e.key === 'Escape') renamingEntry = null;
}}
onblur={() => confirmRename(entry.path)}
autofocus
/>
{:else}
{@const isSelected = selectedPaths.has(entry.path)}
{@const isDragTarget =
dragOverDir !== null &&
(entry.path === dragOverDir || entry.path.startsWith(dragOverDir + '/'))}
{@const fileGitStatus = gitStatusForFile(entry)}
{@const dirGitStatus = gitStatusForDirectory(entry)}
{@const entryGitStatus = fileGitStatus ?? dirGitStatus}
{@const entryGitDecoration = entryGitStatus
? gitStatusDecoration(entryGitStatus.status)
: null}
{/if}
{/each}
{/if}