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

export default function Unit(props) {
  const { unitName, floorList = [] } = props.dataset || {}

  return (
    <div className={Style.unit}>
      <div className={Style['unit-head']}>{unitName}</div>
      <div className={Style['unit-body']}>
        {floorList.map(floor => props.render(floor))}
      </div>
    </div>
  )
}