import React from "react";
import WorkArea from "./WorkArea";
const Floor = ({ floor, workAreas, forBuilding }) => {
  return (
    <React.Fragment key={floor.id}>
      {workAreas && workAreas.length > 0 ? (
        workAreas.map((workArea) => (
          <WorkArea
            forBuilding={forBuilding}
            key={workArea.id}
            workArea={workArea}
            floor={floor}
          />
        ))
      ) : (
        <tr>
          <td colSpan="4" className="text-start table-cell">
            <div className="row ps-2">
              <div className="col-6">
                <div className="row">
                  <div className="col">
                    {" "}
                    <span className="fw-semibold text-primary">
                      Floor:&nbsp;
                    </span>{" "}
                    <span class="fw-normal text-darkgreen">
                      {floor.floorName}
                    </span>
                  </div>
                </div>
              </div>
            </div>
          </td>
        </tr>
      )}
    </React.Fragment>
  );
};
export default Floor;
