Files
martials.no/src/components/links/LocaleLink.astro

17 lines
395 B
Plaintext
Raw Normal View History

---
2025-07-01 20:51:59 +02:00
import { localizeHref, getLocale, type Locale } from "@/paraglide/runtime"
import { type NavLink } from "@/utils/linking"
import type { ComponentProps } from "@/types/props"
interface Props extends ComponentProps {
to: NavLink
2025-07-01 20:51:59 +02:00
lang?: Locale
}
2025-07-01 20:51:59 +02:00
const { to, class: clazz, lang = getLocale() } = Astro.props
---
2025-07-01 20:51:59 +02:00
<a href={localizeHref(to, { locale: lang })} class={clazz}>
<slot />
</a>