<script>
    import { Link, useMatch } from 'svelte-navigator'

    export let to = '#'
    const absoluteMatch = useMatch(to)

    let match;
    $: match = $absoluteMatch?.fullPath === to;
</script>

<li class={"sidebar-item" + (match ? ' active' : '')}>
    <Link class="sidebar-link" {to}>
        <slot />
    </Link>
</li>