Files
web/apps/scandic-web/components/Header/TopLink/index.tsx
Matilda Landström 5de2a993a7 Merged in feat/SW-1711-switch-icons (pull request #1558)
Switches out all the old icons to new ones, and moves them to the design system. The new icons are of three different types: Materialise Symbol, Nucleo, and Customized. Also adds further mapping between facilities/amenities and icons.

Approved-by: Michael Zetterberg
Approved-by: Erik Tiekstra
2025-03-27 09:42:52 +00:00

28 lines
590 B
TypeScript

import { IconName } from "@/components/Icons/iconName"
import HeaderLink from "../HeaderLink"
import type { TopLinkProps } from "@/types/components/header/topLink"
export default function TopLink({
isLoggedIn,
topLink,
iconSize = 16,
}: TopLinkProps) {
const linkData = isLoggedIn ? topLink.logged_in : topLink.logged_out
if (!linkData?.link?.url || !linkData?.title) {
return null
}
return (
<HeaderLink
href={linkData.link.url}
iconName={linkData.icon || IconName.Gift}
iconSize={iconSize}
>
{linkData.title}
</HeaderLink>
)
}