Fix(STAY-128): Handle single ancillaries * fix: refactor ancillaries flow * fix: add logic to determine if an ancillary requires quantity * fix: breakout ancillary description to its own component * fix: cleanup * fix: cleanup Approved-by: Bianca Widstam Approved-by: Erik Tiekstra
23 lines
675 B
TypeScript
23 lines
675 B
TypeScript
import Modal from "@scandic-hotels/design-system/Modal"
|
|
|
|
import { useAddAncillaryStore } from "@/stores/my-stay/add-ancillary-flow"
|
|
|
|
import styles from "./wrapper.module.css"
|
|
|
|
export default function AncillaryFlowModalWrapper({
|
|
children,
|
|
}: React.PropsWithChildren) {
|
|
const { isOpen, closeModal, selectedAncillaryTitle } = useAddAncillaryStore(
|
|
(state) => ({
|
|
isOpen: state.isOpen,
|
|
closeModal: state.closeModal,
|
|
selectedAncillaryTitle: state.selectedAncillary?.title,
|
|
})
|
|
)
|
|
return (
|
|
<Modal isOpen={isOpen} onToggle={closeModal} title={selectedAncillaryTitle}>
|
|
<div className={styles.modalWrapper}>{children}</div>
|
|
</Modal>
|
|
)
|
|
}
|