import { usePisellOS } from "../../../../hooks/useEngineContext";
import { useOsKey } from "../../context/OsKeyContext";
import { getBookingTicketKey } from "../../utils";

/**
 * useBookingTicket Hook
 * 获取当前 TicketBooking 实例对应的 BookingTicket 模块
 * 通过 osKey 区分不同页面的模块实例
 */
export var useBookingTicket = function useBookingTicket() {
  var pisellOS = usePisellOS();
  var osKey = useOsKey();

  // 根据 osKey 生成模块名称
  var moduleKey = getBookingTicketKey(osKey || 'ticket');
  return pisellOS.getModule(moduleKey);
};