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

17 lines
395 B
Plaintext

---
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
lang?: Locale
}
const { to, class: clazz, lang = getLocale() } = Astro.props
---
<a href={localizeHref(to, { locale: lang })} class={clazz}>
<slot />
</a>