---
interface Props {
  to: string
}

const { to } = Astro.props;
const currentPath = new URL(Astro.url).pathname.split('/')[1];
---

<a href={to} class={`/${currentPath}` === to ? 'current' : undefined}>
  <slot />
</a>

<style lang="scss">
a {
	text-decoration: none;
	color: white;
	font-size: large;
	position: relative;
}
</style>