mirror of
https://github.com/aleksilassila/reiverr.git
synced 2026-04-20 00:53:32 +02:00
feat: Add interface for adding and configuring plugins
This commit is contained in:
38
src/lib/components/Dialog/SelectDialog.svelte
Normal file
38
src/lib/components/Dialog/SelectDialog.svelte
Normal 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>
|
||||
Reference in New Issue
Block a user