import React from 'react'
import Style from './style.less'

export default function Floor(props) {
  const { floorName, roomList = [] } = props.dataset || {}

  return (
    <div className={Style.floor}>
      <div className={Style['floor-head']}>{floorName}</div>
      <div className={Style['floor-body']}>
        {roomList.map((room) => {
          return (
            <div className={Style.item} key={room.houseId} >
              {props.render(room)}
            </div>
          )
        })}
      </div>
    </div>
  );
}
