import React, { Component } from 'react';
import { Row, Col } from 'antd-v4';
import { getTheme } from '@antv/g2';
import Pie from '../Pie';

class PieGroup extends Component {
  render() {
    const { data, height } = this.props;
    const column = 24 / data.length;
    const { colors10: colors } = getTheme();
    return (
      <Row gutter={4}>
        {
          data.map((child, i) => {
            const { sId } = child;
            child.height = height;
            child.color = colors[i];
            return (
              <Col span={column} key={sId}>
                <Pie {...child} />
              </Col>
            );
          })
        }
      </Row>
    );
  }
}

export default PieGroup;

