import React, {Component} from 'react';
import {ipcRenderer} from '../../polyfills';
import {Button, Col, Modal, Pagination, Row, Table} from 'antd';
import {selectTestEnvId} from '../../actions/Session';
import SessionStyles from '../Session/Session.css';
import _ from 'lodash';
import CloudProviders from '../Session/CloudProviders';

export default class SelectEnvTable extends Component {
  constructor (props) {
    super(props);
    this.state = {
      data: [],
    }
    this.onSelectChange = this.onSelectChange.bind(this);

  }

  onSelectChange (selectedRowKeys) {
    const {selectTestEnvId} = this.props;
    selectTestEnvId(selectedRowKeys[0]);
  }

  render () {
    const {data} = this.state;

    const columns = [
      {
        title: 'Environment',
        dataIndex: 'label',
      },
    ];
    const rowSelection = {
      type: 'radio',
      onChange: this.onSelectChange,
    };

    return <Modal key="modal"
                  visible={isAddingCloudProvider}
                  onCancel={stopAddCloudProvider}
                  footer={footer}
                  title={t('Select Environment')}>

    </Modal>;


    return <div style={{ height: '100%', overflowY: 'auto' }} >
      <Table
        rowSelection={rowSelection}
        columns={columns}
        dataSource={data}
        pagination={false}
      />
      <div style={{ marginTop: '20px' }} />
    </div>
  }

}
