feat: Manage downloads and local media

This commit is contained in:
Aleksi Lassila
2024-04-02 20:31:40 +03:00
parent 8a6cfc0669
commit 880b653e8d
23 changed files with 540 additions and 296 deletions

View File

@@ -1,3 +1,4 @@
import type { ComponentType, SvelteComponentTyped } from 'svelte';
import { derived, writable } from 'svelte/store';
type ModalItem = {
@@ -18,9 +19,9 @@ function createModalStack() {
items.update((prev) => prev.filter((i) => i.group !== group));
}
function create(
component: ConstructorOfATypedSvelteComponent,
props: Record<string, any>,
function create<P extends Record<string, any>>(
component: ComponentType<SvelteComponentTyped<P>>,
props: Omit<P, 'modalId' | 'hidden'>,
group: symbol | undefined = undefined
) {
const id = Symbol();