import {
  FLOOR_1,
  FLOOR_1_ID,
  GROUND_FLOOR,
  GROUND_FLOOR_ID,
} from '@/constants';

export const formatFloor = (floor: number | string, reverse: boolean = false) => {
  if (reverse) {
    if (floor === FLOOR_1) {
      return FLOOR_1_ID;
    }

    return GROUND_FLOOR_ID;
  }

  if (floor === FLOOR_1_ID) {
    return FLOOR_1;
  }

  return GROUND_FLOOR;
};
