mirror of
https://github.com/ankitects/anki.git
synced 2026-01-15 06:49:03 -05:00
19 lines
539 B
Svelte
19 lines
539 B
Svelte
<!--
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
-->
|
|
<script lang="typescript">
|
|
import Detachable from "components/Detachable.svelte";
|
|
|
|
import { getContext } from "svelte";
|
|
import { buttonGroupKey } from "./contextKeys";
|
|
|
|
export let registration = undefined;
|
|
|
|
const { registerButton } = getContext(buttonGroupKey);
|
|
const { detach } = registration ?? registerButton();
|
|
</script>
|
|
|
|
<Detachable detach={$detach}>
|
|
<slot />
|
|
</Detachable>
|