{#each Object.entries(links) as [name, link] (link)}
{
const keys = Object.keys(links);
const currentIndex = keys.findIndex(
(key) => links[key] === data.pathname,
);
const nextIndex = keys.findIndex(
(key) => links[key] === link,
);
shouldGoBack = nextIndex < currentIndex;
}}
>
{#key name}
{name}
{/key}
{/each}
{#key data.pathname}
{/key}
{@render children()}