Files
web/apps/scandic-web/components/Header/HeaderLink/index.tsx
Christian Andolf 9a37a2f4c0 fix(SW-1971): now closes mobile menu on clicking the find booking link
removed useless class usage

added customer service url to link
2025-03-21 09:18:59 +01:00

31 lines
806 B
TypeScript

"use client"
import Link from "next/link"
import { getIconByIconName } from "@/components/Icons/get-icon-by-icon-name"
import Caption from "@/components/TempDesignSystem/Text/Caption"
import styles from "./headerLink.module.css"
import type { HeaderLinkProps } from "@/types/components/header/headerLink"
export default function HeaderLink({
children,
href,
iconName,
iconSize = 20,
onClick = () => undefined,
}: HeaderLinkProps) {
const Icon = getIconByIconName(iconName)
return (
<Caption type="regular" color="textMediumContrast" asChild>
<Link href={href} className={styles.headerLink} onClick={onClick}>
{Icon ? (
<Icon className={styles.icon} width={iconSize} height={iconSize} />
) : null}
{children}
</Link>
</Caption>
)
}