From fcabd988bd9b98eb5afda600345e14a302fbd4ee Mon Sep 17 00:00:00 2001
From: mat <github@matdoes.dev>
Date: Tue, 15 Feb 2022 03:05:09 +0000
Subject: add stuff

---
 src/lib/ConditionalLink.svelte | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 src/lib/ConditionalLink.svelte

(limited to 'src/lib/ConditionalLink.svelte')

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}
-- 
cgit 

