Files
fnx_web/svelte/src/filesystem/viewers/TorrentItem.svelte
T

26 lines
568 B
Svelte
Raw Normal View History

<script lang="ts">
import { formatDataVolume } from "util/Formatting";
import type { TorrentFile } from "./Torrent.svelte";
2023-05-19 17:17:05 +02:00
export let item: TorrentFile = {} as TorrentFile
2023-05-19 17:17:05 +02:00
</script>
<ul class="list_open">
{#each Object.entries(item.children) as [name, child]}
<li class:list_closed={!child.children}>
{name} ({formatDataVolume(child.size, 3)})<br/>
{#if child.children}
<svelte:self item={child}></svelte:self>
{/if}
</li>
{/each}
</ul>
<style>
.list_open {
list-style-type: disclosure-open;
}
.list_closed {
list-style-type: disc;
}
</style>