aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/src/lib/components/LinkButton.svelte
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-08-20 19:55:21 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-08-20 19:55:21 +0200
commit71d37e758fbc155a14f13989e7ed05e7719c2159 (patch)
tree2780090e1dd784d7a3bfe9e221d87b0df69ef436 /web/pw-server/src/lib/components/LinkButton.svelte
parent329fc73b94852697f7a057957a714d961a2e9e3b (diff)
downloadplanetwars.dev-71d37e758fbc155a14f13989e7ed05e7719c2159.tar.xz
planetwars.dev-71d37e758fbc155a14f13989e7ed05e7719c2159.zip
implement LinkButton component
Diffstat (limited to 'web/pw-server/src/lib/components/LinkButton.svelte')
-rw-r--r--web/pw-server/src/lib/components/LinkButton.svelte7
1 files changed, 7 insertions, 0 deletions
diff --git a/web/pw-server/src/lib/components/LinkButton.svelte b/web/pw-server/src/lib/components/LinkButton.svelte
new file mode 100644
index 0000000..0d0e7d6
--- /dev/null
+++ b/web/pw-server/src/lib/components/LinkButton.svelte
@@ -0,0 +1,7 @@
+<script lang="ts">
+ export let href: string | null;
+
+ $: isDisabled = !href;
+</script>
+
+<a class="btn" class:btn-disabled={isDisabled} {href}><slot /></a>