import React from "react";
const Building = ( {building, toggleBuilding, expandedBuildings, getContent} ) =>
{

    return (
      <React.Fragment key={building.id}>
        <tr className="overflow-auto">
          <td
            colSpan="4"
            className="text-start"
            style={{ background: "#f0f0f0", cursor: "pointer" }}
            onClick={() => toggleBuilding(building.id)}
          >
            <div className="row table-responsive">
              <h5 style={{ marginBottom: "0px" }}>
                {building.name} &nbsp;
                {expandedBuildings.includes(building.id) ? (
                  <i className="bx bx-chevron-down"></i>
                ) : (
                  <i className="bx bx-chevron-right"></i>
                )}
              </h5>
            </div>
          </td>
        </tr>
  
        {expandedBuildings.includes(building.id) && getContent(building)}
      </React.Fragment>
    );
  };
  export default Building