<svelte:options
	customElement={{
		tag: 'eve-arxlet-sublink'
	}}
/>

<script lang="ts">
	import { page } from '$app/state';

	const { href, arxlet, ...rest }: { href: string; arxlet?: string } = $props();

	const arxletId = $derived(arxlet ? arxlet : page.params.id);
</script>

{#if page.route.id === '/app/[id]'}
	<a {...rest} href="/app/{arxletId}/{href}">
		<slot />
	</a>
{:else}
	<slot />
{/if}

<style>
	a {
		text-decoration: none;
		color: inherit;
	}
</style>
