17 lines
423 B
Plaintext
17 lines
423 B
Plaintext
|
---
|
||
|
import { languageTag, type AvailableLanguageTag } from "@/paraglide/runtime"
|
||
|
import { localizePathname, type NavLink } from "@/utils/linking"
|
||
|
import type { ComponentProps } from "@/types/props"
|
||
|
|
||
|
interface Props extends ComponentProps {
|
||
|
to: NavLink
|
||
|
lang?: AvailableLanguageTag
|
||
|
}
|
||
|
|
||
|
const { to, class: clazz, lang = languageTag() } = Astro.props
|
||
|
---
|
||
|
|
||
|
<a href={localizePathname(to, lang)} class={clazz}>
|
||
|
<slot />
|
||
|
</a>
|