aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ConditionalLink.svelte
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-02-15 03:05:09 +0000
committermat <github@matdoes.dev>2022-02-15 03:05:09 +0000
commitfcabd988bd9b98eb5afda600345e14a302fbd4ee (patch)
tree069724e9e0b3543d33fe1ee73f1523cf13b2e1f7 /src/lib/ConditionalLink.svelte
parentffe5eea0ce73cae8657c547f881b6f41270fef37 (diff)
downloadskyblock-stats-fcabd988bd9b98eb5afda600345e14a302fbd4ee.tar.gz
skyblock-stats-fcabd988bd9b98eb5afda600345e14a302fbd4ee.tar.bz2
skyblock-stats-fcabd988bd9b98eb5afda600345e14a302fbd4ee.zip
add stuff
Diffstat (limited to 'src/lib/ConditionalLink.svelte')
-rw-r--r--src/lib/ConditionalLink.svelte13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/ConditionalLink.svelte b/src/lib/ConditionalLink.svelte
new file mode 100644
index 0000000..933d425
--- /dev/null
+++ b/src/lib/ConditionalLink.svelte
@@ -0,0 +1,13 @@
+<!-- https://stackoverflow.com/a/65837525 -->
+<script lang="ts">
+ export let isWrapped = false;
+ export let href: string;
+</script>
+
+{#if isWrapped}
+ <a {href}>
+ <slot />
+ </a>
+{:else}
+ <slot />
+{/if}