import { IconName } from "@scandic-hotels/design-system/Icons/iconName" import HeaderLink from "../HeaderLink" import styles from "./topLink.module.css" import type { Header } from "@scandic-hotels/trpc/types/header" import type { ComponentProps } from "react" interface TopLinkProps extends Omit< ComponentProps, "href" | "iconName" | "children" > { isLoggedIn: boolean topLink: Header["header"]["topLink"] iconSize?: number } export default function TopLink({ isLoggedIn, topLink, iconSize = 16, ...props }: TopLinkProps) { const linkData = isLoggedIn ? topLink.logged_in : topLink.logged_out if (!linkData?.url || !linkData?.title) { return null } return ( {linkData.title} ) }