refactor(#35): move nav components

This commit is contained in:
OllyNicholass
2024-10-24 00:38:26 +01:00
parent 3a5e961d54
commit 08a6f6d7cc
4 changed files with 5 additions and 5 deletions
@@ -0,0 +1,43 @@
<script lang="ts">
import { type NavLinkItem } from '$lib/types/Nav/NavLinkItem';
import NavLinkParent from './NavLinkParent.svelte';
export let isMobile = false;
const links: NavLinkItem[] = [
{
text: 'Products',
href: '/products'
},
{
text: 'Parent',
isParent: true,
children: [
{
text: 'Submenu 1',
href: '/'
},
{
text: 'Submenu 2',
href: '/'
}
]
},
{
text: 'Example Product',
href: '/tools/exampleproduct'
}
];
</script>
<ul class:flex={!isMobile} class:space-x-4={!isMobile}>
{#each links as link}
<li>
{#if link.isParent}
<NavLinkParent text={link.text} children={link.children} {isMobile} />
{:else}
<a href={link.href}>{link.text}</a>
{/if}
</li>
{/each}
</ul>