Merged in fix/STAY-65-manage-stay (pull request #3089)
Fix/STAY-65 manage stay * fix: Disable manage stay for past bookings * fix: handle past and cancelled stay the same * fix: indentify past booking * fix: refactor to use design system components Approved-by: Erik Tiekstra
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
"use client"
|
||||
import { useMyStayStore } from "@/stores/my-stay"
|
||||
|
||||
import Cancelled from "./Cancelled"
|
||||
import NotCancelled from "./NotCancelled"
|
||||
import NotUpcoming from "./NotUpcoming"
|
||||
import Upcoming from "./Upcoming"
|
||||
|
||||
import styles from "./actions.module.css"
|
||||
|
||||
export default function Actions() {
|
||||
const isCancelled = useMyStayStore((state) => state.bookedRoom.isCancelled)
|
||||
const isPastBooking = useMyStayStore((state) => state.isPastBooking)
|
||||
|
||||
const isActionable = !isCancelled && !isPastBooking
|
||||
return (
|
||||
<div className={styles.actionArea}>
|
||||
{isCancelled ? <Cancelled /> : <NotCancelled />}
|
||||
{isActionable ? <Upcoming /> : <NotUpcoming />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user