Testing page generation
This commit is contained in:
24
src/routes/upload/+page.svelte
Normal file
24
src/routes/upload/+page.svelte
Normal file
@@ -0,0 +1,24 @@
|
||||
<script lang="ts">
|
||||
import FileUpload from '$lib/components/FileUpload.svelte';
|
||||
import { unzipManga } from '$lib/upload';
|
||||
import type { Entry } from '@zip.js/zip.js';
|
||||
|
||||
let promise: Promise<Entry[]> | undefined;
|
||||
|
||||
async function onUpload(files: FileList) {
|
||||
const [file] = files;
|
||||
promise = unzipManga(file);
|
||||
}
|
||||
</script>
|
||||
|
||||
<FileUpload {onUpload} accept=".mokuro,.zip,.cbz,.rar" />
|
||||
|
||||
{#if promise}
|
||||
{#await promise}
|
||||
<p>Loading...</p>
|
||||
{:then entries}
|
||||
{#each entries as entry}
|
||||
<p>{entry.filename}</p>
|
||||
{/each}
|
||||
{/await}
|
||||
{/if}
|
||||
Reference in New Issue
Block a user