import React from 'react';
import classNames from 'classnames';
import { isFloorRoomCardTooltipDensity, useFloorRoomCardDensity } from "../floorRoomCardDensity";
import { useFloorRoomCardLayoutOptions } from "../floorRoomCardLayoutOptions";
/**
 * 单张 RoomCard 根壳：顶栏 + 可选主体。
 * comfortable：方桌顶栏与正文分两截；圆桌在 {@link FloorRoomCardLayoutOptions.discUnifiedLayoutEnabled} 开启时合并为 `.rc-unified`。
 * 其它档位：合并为 `.rc-unified`。
 */
export function RoomCardShellView(props) {
  var className = props.className,
    checkoutBookingKey = props.checkoutBookingKey,
    header = props.header,
    children = props.children,
    ribbonSlot = props.ribbonSlot,
    cornerSlot = props.cornerSlot,
    _props$shellShape = props.shellShape,
    shellShape = _props$shellShape === void 0 ? 'rect' : _props$shellShape,
    _props$tooltipTimeSta = props.tooltipTimeStandaloneMain,
    tooltipTimeStandaloneMain = _props$tooltipTimeSta === void 0 ? false : _props$tooltipTimeSta;
  var density = useFloorRoomCardDensity();
  var _useFloorRoomCardLayo = useFloorRoomCardLayoutOptions(),
    discUnifiedLayoutEnabled = _useFloorRoomCardLayo.discUnifiedLayoutEnabled;
  /** compact 方桌拆顶栏；Tooltip 小卡档（方桌 micro / 圆桌 mini+micro）与合并壳（见 FloorRoomCardFromData） */
  var mergeHeaderBody = shellShape === 'circle' && discUnifiedLayoutEnabled || isFloorRoomCardTooltipDensity(density, shellShape);
  var mergedMainClassName = tooltipTimeStandaloneMain ? 'rc-tooltip-time-main' : 'rc-unified';
  var main = mergeHeaderBody ? /*#__PURE__*/React.createElement("div", {
    className: mergedMainClassName
  }, header != null ? header : null, children) : /*#__PURE__*/React.createElement(React.Fragment, null, header != null ? header : null, children);
  return /*#__PURE__*/React.createElement("div", {
    className: classNames(className, 'rc-shell'),
    "data-pisell-floor-checkout-booking": checkoutBookingKey
  }, ribbonSlot, cornerSlot, main);
}