mirror of
https://github.com/sergeyyarkov/yarkov.tech.git
synced 2026-10-12 02:49:08 +03:00
13 lines
335 B
Plaintext
13 lines
335 B
Plaintext
---
|
|
export interface Props extends astroHTML.JSX.AnchorHTMLAttributes {}
|
|
|
|
const { href, class: className, ...props } = Astro.props;
|
|
|
|
const { pathname } = Astro.url;
|
|
const isActive = href === pathname || href === pathname.replace(/\/$/, "");
|
|
---
|
|
|
|
<a href={href} class:list={[className, { active: isActive }]} {...props}>
|
|
<slot />
|
|
</a>
|