Feat/BOOK-61 refactor hotel page css variables * feat(BOOK-61): Breadcrumbs * feat(BOOK-61): intro section * feat(BOOK-61): show more button * feat(BOOK-61): rooms section * feat(BOOK-61): sidepeeks * feat(BOOK-61): deprecated old Link component * feat(BOOK-61): added new TextLink component to the design-system * feat(BOOK-61): replaced deprecated links with new TextLink component * feat(BOOK-61): miscellaneous changes Approved-by: Bianca Widstam Approved-by: Christel Westerberg
32 lines
704 B
TypeScript
32 lines
704 B
TypeScript
'use client'
|
|
|
|
import { login } from '@scandic-hotels/common/constants/routes/handleAuth'
|
|
import Link, { type LinkProps } from '../OldDSLink'
|
|
|
|
import type { Lang } from '@scandic-hotels/common/constants/language'
|
|
import type { PropsWithChildren } from 'react'
|
|
|
|
export function LoginButton({
|
|
lang,
|
|
redirectTo,
|
|
trackingId,
|
|
children,
|
|
...props
|
|
}: PropsWithChildren<
|
|
{
|
|
lang: Lang
|
|
redirectTo: string | null
|
|
trackingId: string
|
|
} & Omit<LinkProps, 'href'>
|
|
>) {
|
|
const href = redirectTo
|
|
? `${login[lang]}?redirectTo=${encodeURIComponent(redirectTo)}`
|
|
: login[lang]
|
|
|
|
return (
|
|
<Link id={trackingId} href={href} prefetch={false} {...props}>
|
|
{children}
|
|
</Link>
|
|
)
|
|
}
|