{#if !isRunning}
File browser is only available for running capsules.
{:else}
(pathInputFocused = true)} onblur={() => (pathInputFocused = false)} onkeydown={handleKeydown} placeholder="/path/to/file" spellcheck="false" autocomplete="off" class="flex-1 bg-transparent font-mono text-meta text-[var(--color-text-primary)] outline-none placeholder:text-[var(--color-text-muted)]" />
{#each breadcrumbs() as crumb, i} {#if i > 0} {/if} {/each}
{#if dirLoading}
Loading...
{:else if dirError}
{dirError}
{:else if entries.length === 0}
Empty directory
{:else} {#if currentPath !== '/'} {/if} {#each sortedEntries as entry (entry.path)} {/each} {/if}
{#if !dirLoading && !dirError}
{entries.length} item{entries.length !== 1 ? 's' : ''}
{/if}
{#if !selectedFile}
Select a file to preview
{:else}
{selectedFile.path}
{formatFileSize(selectedFile.size)}
{#if fileLoading}
Reading file...
{:else if fileError}
{fileError}
{:else if isBinaryFile(selectedFile.name) || isFileTooLarge(selectedFile.size) || (selectedFile && fileContent === null && !fileLoading)}
{#if isFileTooLarge(selectedFile.size)} {:else} {/if}
{#if isFileTooLarge(selectedFile.size)} File too large to preview {formatFileSize(selectedFile.size)} exceeds the 10 MB preview limit {:else} Binary file This file cannot be displayed as text {/if}
{:else if fileContent !== null}
{#each fileContent.split('\n') as line, i}
{i + 1}{line}
{/each}
{/if}
{/if}
{/if}