"use client"

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

import Details from "./Details"

import type { Room } from "@/types/stores/my-stay"
import type { SafeUser } from "@/types/user"

interface GuestDetailsProps {
  selectedRoom?: Room
  user: SafeUser
}

export default function GuestDetails({
  selectedRoom,
  user,
}: GuestDetailsProps) {
  const booking = useMyStayStore((state) => state.bookedRoom)
  const room = selectedRoom ? selectedRoom : booking

  return <Details booking={room} user={user} />
}
