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">
              <div className="row ps-2">
                <div className="col-6">
                  <h6>
                    <span>{floor.floorName} &nbsp;</span>
                  </h6>
                </div>
              </div>
            </td>
          </tr>
        )}
        
      </React.Fragment>
    );
  };
  export default Floor