import { View } from "@tarojs/components";
import Room from "./Room";
import './floor.scss'

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

  return (
    <View className="floor">
      <View className="head">{floorName}</View>
      <View className="body">
        {roomList.map((room) => {
          return (
            <View className="item" key={room.houseId} >
              <Room
                dataset={room}
                showDataType={props.showDataType}
                onClick={props.onRoomClick}
                chooseList={props.chooseList}
                showAction={props.showAction}
                onActionClick={props.onActionClick}
              />
            </View>
          )
        })}
      </View>
    </View>
  );
}
