From 915ee0a9c28d2d9371848ca8a0559bd82cb5c9be Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Wed, 10 Aug 2022 23:34:24 +0200
Subject: refactor: Use anchor tag when isLink is true

---
 apps/web-shared/src/components/breadcrumb/crumb.svelte | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

(limited to 'apps/web-shared/src/components/breadcrumb/crumb.svelte')

diff --git a/apps/web-shared/src/components/breadcrumb/crumb.svelte b/apps/web-shared/src/components/breadcrumb/crumb.svelte
index 7621de6..e540a44 100644
--- a/apps/web-shared/src/components/breadcrumb/crumb.svelte
+++ b/apps/web-shared/src/components/breadcrumb/crumb.svelte
@@ -1,11 +1,16 @@
 <script>
-	export let name;
-	export let withArrow = false;
-	export let isLink = false;
+    export let name;
+    export let withArrow = false;
+    export let isLink = false;
 </script>
 <li class="breadcrumbs__item">
-    <span class="color-inherit {isLink ? 'cursor-pointer color-primary-light' : ''}"
-          on:click>{name}</span>
+    {#if isLink}
+        <a class="color-inherit {isLink ? 'cursor-pointer color-primary-light' : ''}"
+           on:click>{name}</a>
+    {:else}
+        <span class="color-inherit {isLink ? 'cursor-pointer color-primary-light' : ''}"
+              on:click>{name}</span>
+    {/if}
     {#if withArrow}
         <svg class="icon margin-left-xxxs color-contrast-low"
              aria-hidden="true"
-- 
cgit v1.3

