import { locales } from "@pisell/utils";
//#region src/plus/pisellReservation/floorRoomCard/floorRoomCardHeaderFormat.ts
/**
* RoomCard 顶栏文案：供容器、View-all 标题、对外 map 复用。
*/
const I18N_STATUS_OCC = "pisell-reservation.room-status-occupied";
const I18N_STATUS_RES = "pisell-reservation.room-status-reserved";
const I18N_STATUS_EMPTY = "pisell-reservation.room-status-empty";
const I18N_STATUS_LOCK = "pisell-reservation.room-status-locked";
const I18N_CAP = "pisell-reservation.room-cap-prefix";
function formatRoomCapLine(data, bookingsForOcc) {
	const occSum = bookingsForOcc.length > 0 ? bookingsForOcc.reduce((acc, b) => {
		const n = Number(b.number);
		return acc + (Number.isFinite(n) ? n : 0);
	}, 0) : null;
	const capPrefix = locales.getText(I18N_CAP);
	return occSum != null ? `${capPrefix}: ${occSum}/${data.capacity}` : `${capPrefix}: ${data.capacity}`;
}
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 "";
	}
}
//#endregion
export { floorRoomCardStatusTagLabel, formatRoomCapLine };
