anki/ts/deck-options/TimerOptions.svelte

43 lines
1.3 KiB
Svelte
Raw Normal View History

2021-05-27 23:19:05 +02:00
<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import * as tr from "lib/i18n";
import TitledContainer from "./TitledContainer.svelte";
import Item from "components/Item.svelte";
import SpinBoxRow from "./SpinBoxRow.svelte";
2021-06-12 10:25:11 +02:00
import SwitchRow from "./SwitchRow.svelte";
2021-05-27 23:19:05 +02:00
import type { DeckOptionsState } from "./lib";
export let state: DeckOptionsState;
2021-05-29 17:32:12 +02:00
export let api: Record<string, never>;
2021-05-27 23:19:05 +02:00
let config = state.currentConfig;
let defaults = state.defaults;
</script>
2021-05-29 17:32:12 +02:00
<TitledContainer title={tr.deckConfigTimerTitle()} {api}>
<Item>
<SpinBoxRow
bind:value={$config.capAnswerTimeToSecs}
defaultValue={defaults.capAnswerTimeToSecs}
min={30}
max={600}
markdownTooltip={tr.deckConfigMaximumAnswerSecsTooltip()}
>
{tr.deckConfigMaximumAnswerSecs()}
</SpinBoxRow>
</Item>
2021-05-27 23:19:05 +02:00
<Item>
2021-06-12 10:25:11 +02:00
<SwitchRow
bind:value={$config.showTimer}
defaultValue={defaults.showTimer}
markdownTooltip={tr.deckConfigShowAnswerTimerTooltip()}
>
{tr.schedulingShowAnswerTimer()}
2021-06-12 10:25:11 +02:00
</SwitchRow>
</Item>
2021-05-27 23:19:05 +02:00
</TitledContainer>