Skip to content

Instantly share code, notes, and snippets.

@skflowne
Last active August 5, 2020 00:09
Show Gist options
  • Select an option

  • Save skflowne/078466459b47f70a4b9cda919ef12fb5 to your computer and use it in GitHub Desktop.

Select an option

Save skflowne/078466459b47f70a4b9cda919ef12fb5 to your computer and use it in GitHub Desktop.
<script lang="ts">
import type { File } from "../../interfaces/file.interface"
import FileItem from "./FileItem.svelte"
import fileIndex from "../../store/fileIndex"
export let searching: boolean = false
export let files: File[] = []
</script>
<div class="w-4/5 mx-auto">
{#if files.length > 0}
{#each files as file, index (file.id)}
<FileItem active={searching && index === $fileIndex} {file} />
{/each}
{:else}
<div>
<h3>No matching files found</h3>
</div>
{/if}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment