feat(SW-2879): Move BookingWidget to booking-flow package * Fix lockfile * Fix styling * a tiny little booking widget test * Tiny fixes * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Remove unused scripts * lint:fix * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Tiny lint fixes * update test * Update Input in booking-flow * Clean up comments etc * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Setup tracking context for booking-flow * Add missing use client * Fix temp tracking function * Pass booking to booking-widget * Remove comment * Add use client to booking widget tracking provider * Add use client to tracking functions * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Move debug page * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package Approved-by: Bianca Widstam
70 lines
1.8 KiB
TypeScript
70 lines
1.8 KiB
TypeScript
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
|
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
|
import Subtitle from "@scandic-hotels/design-system/Subtitle"
|
|
|
|
import styles from "./modalContent.module.css"
|
|
|
|
import type { ReactNode } from "react"
|
|
|
|
interface ModalContentProps {
|
|
title?: string
|
|
content: ReactNode
|
|
primaryAction: {
|
|
label: string
|
|
onClick: () => void
|
|
intent?: "primary" | "secondary" | "text"
|
|
isLoading?: boolean
|
|
disabled?: boolean
|
|
} | null
|
|
secondaryAction: {
|
|
label: string
|
|
onClick: () => void
|
|
intent?: "primary" | "secondary" | "text"
|
|
} | null
|
|
onClose?: () => void
|
|
}
|
|
|
|
export function ModalContentWithActions({
|
|
title,
|
|
content,
|
|
primaryAction,
|
|
secondaryAction,
|
|
onClose,
|
|
}: ModalContentProps) {
|
|
return (
|
|
<>
|
|
{title && (
|
|
<header className={styles.header}>
|
|
<Subtitle>{title}</Subtitle>
|
|
<button onClick={onClose} type="button" className={styles.close}>
|
|
<MaterialIcon icon="close" color="Icon/Interactive/Placeholder" />
|
|
</button>
|
|
</header>
|
|
)}
|
|
<div className={styles.content}>{content}</div>
|
|
<footer className={styles.footer}>
|
|
{secondaryAction && (
|
|
<Button
|
|
theme="base"
|
|
intent={secondaryAction.intent ?? "text"}
|
|
color="burgundy"
|
|
onClick={secondaryAction.onClick}
|
|
>
|
|
{secondaryAction.label}
|
|
</Button>
|
|
)}
|
|
{primaryAction && (
|
|
<Button
|
|
theme="base"
|
|
intent={primaryAction.intent ?? "secondary"}
|
|
onClick={primaryAction.onClick}
|
|
disabled={primaryAction.isLoading || primaryAction.disabled}
|
|
>
|
|
{primaryAction.label}
|
|
</Button>
|
|
)}
|
|
</footer>
|
|
</>
|
|
)
|
|
}
|