anki/ts/editor/PreviewButton.svelte

23 lines
777 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="typescript">
import { bridgeCommand } from "lib/bridgecommand";
import * as tr from "lib/i18n";
2021-06-24 16:44:08 +02:00
import { withButton } from "components/helpers";
import WithShortcut from "components/WithShortcut.svelte";
import LabelButton from "components/LabelButton.svelte";
</script>
<WithShortcut shortcut={"Control+Shift+P"} let:createShortcut let:shortcutLabel>
<LabelButton
2021-05-07 02:03:00 +02:00
tooltip={tr.browsingPreviewSelectedCard({ val: shortcutLabel })}
on:click={() => bridgeCommand("preview")}
2021-06-24 16:44:08 +02:00
on:mount={withButton(createShortcut)}
>
{tr.actionsPreview()}
</LabelButton>
</WithShortcut>