mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 23:42:23 -04:00
29 lines
855 B
Svelte
29 lines
855 B
Svelte
<!--
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
-->
|
|
<script lang="ts">
|
|
import { mdiBookOutline } from "./icons";
|
|
import { getDeckNames } from "@generated/backend";
|
|
import ItemChooser from "./ItemChooser.svelte";
|
|
import type { DeckNameId } from "@generated/anki/decks_pb";
|
|
import * as tr from "@generated/ftl";
|
|
|
|
let decks: DeckNameId[] = $state([]);
|
|
let selectedDeck: DeckNameId | null = $state(null);
|
|
|
|
$effect(() => {
|
|
getDeckNames({ skipEmptyDefault: true, includeFiltered: false }).then(
|
|
(response) => {
|
|
decks = response.entries;
|
|
},
|
|
);
|
|
});
|
|
</script>
|
|
|
|
<ItemChooser
|
|
title={tr.qtMiscChooseDeck()}
|
|
bind:selectedItem={selectedDeck}
|
|
items={decks}
|
|
icon={mdiBookOutline}
|
|
/>
|