Merged in chore/SW-3397-move-confirmation-component-with (pull request #2759)
chore(SW-3397) Moved Confirmation component with Header to booking-flow package * chore(SW-3397) Moved Confirmation component with Header to booking-flow package * chore(SW-3397): Optimised code Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
"use client"
|
||||
|
||||
import { useRef } from "react"
|
||||
|
||||
import { Header } from "../Header"
|
||||
|
||||
import styles from "./confirmation.module.css"
|
||||
|
||||
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
||||
|
||||
import type { BookingConfirmationRoom } from "../../../types/components/bookingConfirmation/bookingConfirmation"
|
||||
|
||||
interface ConfirmationProps
|
||||
extends Pick<BookingConfirmation, "booking" | "hotel"> {
|
||||
room: BookingConfirmationRoom
|
||||
}
|
||||
|
||||
export function Confirmation({
|
||||
booking,
|
||||
hotel,
|
||||
children,
|
||||
}: React.PropsWithChildren<ConfirmationProps>) {
|
||||
const mainRef = useRef<HTMLElement | null>(null)
|
||||
|
||||
return (
|
||||
<main className={styles.main} ref={mainRef}>
|
||||
<Header booking={booking} hotel={hotel} mainRef={mainRef} />
|
||||
{children}
|
||||
</main>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user