Files
web/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/EmptyUpcomingStays/index.tsx
Chuma Mcphoy (We Ahead) 56d5ad77d1 Merged in fix/SW-2068-correct-public-url-from-my-stays-overview-page (pull request #1694)
feat(SW-2068): Link to Correct Public URL from within My Stays Overview Page

* feat(SW-2068): Link to Correct Public URL from within My Stays Overview Page

- Added language parameter to previous and upcoming stays queries.
- Updated Client components to utilize the new language hook.
- Refactored EmptyUpcomingStays component to dynamically generate links based on the current language.
- Adjusted user input validation to include optional language parameter.

* refactor(SW-2068): Update EmptyUpcomingStays components to use PUBLIC_URL + add utility to handle TLD based on language

* chore(SW-2068): Clarify TLD

* feat(SW-2068): documentation for getTldForLanguage

* refactor(SW-2068): Simplify booking URL construction in updateStaysBookingUrl

* refactor(SW-2068): Remove incorrect TLD update logic from booking URL construction

* refactor(SW-2068): Centralize booking URL paths using myBookingPath constant

* refactor(SW-2068): Streamline search params in booking URL construction logic in updateStaysBookingUrl


Approved-by: Christian Andolf
2025-04-02 12:44:02 +00:00

44 lines
1.3 KiB
TypeScript

import { MaterialIcon } from "@scandic-hotels/design-system/Icons"
import { env } from "@/env/server"
import Link from "@/components/TempDesignSystem/Link"
import Title from "@/components/TempDesignSystem/Text/Title"
import { getIntl } from "@/i18n"
import { getLang } from "@/i18n/serverContext"
import { getCurrentWebUrl } from "@/utils/url"
import styles from "./emptyUpcomingStays.module.css"
export default async function EmptyUpcomingStaysBlock() {
const intl = await getIntl()
const lang = getLang()
const href = env.HIDE_FOR_NEXT_RELEASE
? getCurrentWebUrl("/", lang)
: `/${lang}`
return (
<section className={styles.container}>
<div className={styles.titleContainer}>
<Title
as="h4"
level="h3"
color="red"
className={styles.title}
textAlign="center"
>
{intl.formatMessage({ id: "You have no upcoming stays." })}
<span className={styles.burgundyTitle}>
{intl.formatMessage({ id: "Where should you go next?" })}
</span>
</Title>
</div>
<Link href={href} className={styles.link} color="peach80">
{intl.formatMessage({ id: "Get inspired" })}
<MaterialIcon icon="arrow_forward" color="CurrentColor" />
</Link>
</section>
)
}