anki/ts/deck-options/Addons.svelte

29 lines
943 B
Svelte
Raw Normal View History

<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
2021-05-27 23:19:05 +02:00
import TitledContainer from "./TitledContainer.svelte";
2021-04-25 10:40:02 +02:00
import type { DeckOptionsState } from "./lib";
2021-04-25 10:40:02 +02:00
export let state: DeckOptionsState;
2021-05-29 17:32:12 +02:00
export let api: Record<string, never>;
let components = state.addonComponents;
const auxData = state.currentAuxData;
</script>
{#if $components.length || state.haveAddons}
2021-05-29 17:32:12 +02:00
<TitledContainer title="Add-ons" {api}>
<p>
If you're using an add-on that hasn't been updated to use this new screen
yet, you can access the old deck options screen by holding down the shift
key when opening the options.
</p>
{#each $components as addon}
<svelte:component this={addon.component} bind:data={$auxData} {...addon} />
{/each}
2021-05-27 23:19:05 +02:00
</TitledContainer>
{/if}