* feat(SW-3108): Added external link options to shortcuts * feat(SW-3108): Added external link options to header Approved-by: Matilda Landström
28 lines
596 B
TypeScript
28 lines
596 B
TypeScript
import { IconName } from "@scandic-hotels/design-system/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?.url || !linkData?.title) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<HeaderLink
|
|
href={linkData.url}
|
|
iconName={linkData.icon || IconName.Gift}
|
|
iconSize={iconSize}
|
|
>
|
|
{linkData.title}
|
|
</HeaderLink>
|
|
)
|
|
}
|