import * as React from 'react';
import { Columns, Column } from 'bloomer';
import { Chart } from './Chart';

export default class ChartLoader extends React.Component<any, any> {
  public render() {
    const colorMaps = this.props.colorMaps;
    return (
      <Columns>
        {this.props.chartList.map((o: any, i: number) => {
          const colorMap = colorMaps[o.chartColumn];
          return (
            <Column key={i} isSize={3}>
              <Chart csvFile={o.fileName} chartColumn={o.chartColumn} colorMap={colorMap} />
            </Column>
          );
        }

        )}
      </Columns>
    )
  }
}
