Add torrent file explorer
This commit is contained in:
28
svelte/src/file_viewer/viewers/TorrentItem.svelte
Normal file
28
svelte/src/file_viewer/viewers/TorrentItem.svelte
Normal file
@@ -0,0 +1,28 @@
|
||||
<script>
|
||||
import { formatDataVolume } from "../../util/Formatting.svelte";
|
||||
|
||||
export let item = {
|
||||
size: 0,
|
||||
children: null,
|
||||
}
|
||||
</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>
|
Reference in New Issue
Block a user