feat: Add interface for adding and configuring plugins

This commit is contained in:
Aleksi Lassila
2024-12-06 03:41:29 +02:00
parent 9b6ff3379e
commit d3818903b3
27 changed files with 624 additions and 83 deletions

View File

@@ -0,0 +1,38 @@
<script lang="ts">
import Dialog from '../Dialog/Dialog.svelte';
import type { JellyfinUser } from '../../apis/jellyfin/jellyfin-api';
import SelectItem from '../SelectItem.svelte';
import { modalStack } from '../Modal/modal.store';
export let title: string = 'Select';
export let subtitle: string = '';
export let options: string[];
export let selectedOption: string | undefined = undefined;
export let handleSelectOption: (option: string) => void;
export let modalId: symbol;
function handleSelect(option: string) {
handleSelectOption(option);
modalStack.close(modalId);
}
</script>
<Dialog>
<div class="mb-4">
<slot>
<h1 class="header1">{title}</h1>
<p class="text-secondary-300">{subtitle}</p>
</slot>
</div>
<div class="space-y-4">
{#each options as option}
<SelectItem
selected={selectedOption === option}
on:clickOrSelect={() => handleSelect(option)}
>
{option}
</SelectItem>
{/each}
</div>
</Dialog>