<script lang="ts">
    import {link} from "svelte-spa-router";
    import Icon from "$shared/components/icon.svelte";
    
    export let external = "";
    export let to = "";
    export let text;
    export let icon;
</script>

<li class="sidenav-v4__item">
    <a class="sidenav-v4__link" href={to ?? external} use:link={external === ""}>
        {#if icon}
            <Icon class="sidenav-v4__icon icon" name="{icon}" />
        {/if}
        <span>{text}</span>
    </a>
</li>
