/**
 * RoomCard 顶栏文案：供容器、View-all 标题、对外 map 复用。
 */
import { locales } from '@pisell/utils';
var I18N_STATUS_OCC = 'pisell-reservation.room-status-occupied';
var I18N_STATUS_RES = 'pisell-reservation.room-status-reserved';
var I18N_STATUS_EMPTY = 'pisell-reservation.room-status-empty';
var I18N_STATUS_LOCK = 'pisell-reservation.room-status-locked';
var I18N_CAP = 'pisell-reservation.room-cap-prefix';
export function formatRoomCapLine(data, bookingsForOcc) {
  var occSum = bookingsForOcc.length > 0 ? bookingsForOcc.reduce(function (acc, b) {
    var n = Number(b.number);
    return acc + (Number.isFinite(n) ? n : 0);
  }, 0) : null;
  var capPrefix = locales.getText(I18N_CAP);
  return occSum != null ? "".concat(capPrefix, ": ").concat(occSum, "/").concat(data.capacity) : "".concat(capPrefix, ": ").concat(data.capacity);
}
export function floorRoomCardStatusTagLabel(status) {
  switch (status) {
    case 'empty':
      return locales.getText(I18N_STATUS_EMPTY);
    case 'reserved':
      return locales.getText(I18N_STATUS_RES);
    case 'occupied':
      return locales.getText(I18N_STATUS_OCC);
    case 'locked':
      return locales.getText(I18N_STATUS_LOCK);
    default:
      return '';
  }
}