mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-13 02:53:50 +00:00
42 lines
726 B
Svelte
42 lines
726 B
Svelte
<script lang="ts">
|
|
import { type NavLinkItem } from '$lib/types/Nav/NavLinkItem';
|
|
import NavLinkParent from './NavLinkParent.svelte';
|
|
|
|
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 space-x-4">
|
|
{#each links as link}
|
|
<li class="relative">
|
|
{#if link.isParent}
|
|
<NavLinkParent text={link.text} children={link.children} />
|
|
{:else}
|
|
<a href={link.href}>{link.text}</a>
|
|
{/if}
|
|
</li>
|
|
{/each}
|
|
</ul>
|