"use client"

import { useMyStayStore } from "@/stores/my-stay"

import Price from "../PriceType/Price"

export default function TotalPrice() {
  const { bookedRoom, totalPrice, allRoomsAreCancelled } = useMyStayStore(
    (state) => ({
      bookedRoom: state.bookedRoom,
      totalPrice: state.totalPrice,
      allRoomsAreCancelled: state.allRoomsAreCancelled,
    })
  )

  return (
    <Price
      isCancelled={allRoomsAreCancelled}
      isMember={bookedRoom.rateDefinition.isMemberRate}
      price={totalPrice}
    />
  )
}
