Files
web/apps/scandic-web/server/routers/navigation/mypages/getSecondaryLinks.ts
Joakim Jäderberg cbbde963dc Merged in fix/my-pages-menu-not-translated (pull request #2045)
fix: my pages menu not translated

* fix: my pages menu not translated
fix: able to pass lang to getIntl()


Approved-by: Michael Zetterberg
2025-05-12 07:57:11 +00:00

33 lines
701 B
TypeScript

import * as routes from "@/constants/routes/myPages"
import { getIntl } from "@/i18n"
import type { Lang } from "@/constants/languages"
import type { MyPagesLink } from "./MyPagesLink"
export async function getSecondaryLinks({
lang,
}: {
lang: Lang
}): Promise<MyPagesLink[]> {
const intl = await getIntl({ lang })
const menuItems: MyPagesLink[] = [
{
type: "link",
text: intl.formatMessage({
defaultMessage: "About Scandic Friends",
}),
href: routes.scandicFriends[lang],
},
{
type: "link",
text: intl.formatMessage({
defaultMessage: "My profile",
}),
href: routes.profile[lang],
},
]
return menuItems
}