{"size": 1088, "ext": "js", "max_stars_repo_path": "src/common/Table.js", "max_stars_repo_name": "serban-petrescu/react-hcm-proto", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/common/Table.js", "max_issues_repo_name": "serban-petrescu/react-hcm-proto", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/common/Table.js", "max_forks_repo_name": "serban-petrescu/react-hcm-proto", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.0, "max_line_length": 126, "alphanum_fraction": 0.2987132353}
import React from 'react';

export default ({data, columns, remove}) => (
    <table className="table is-marginless">
        <thead>
            <tr>
                {
                    columns.map(function(col, i) {
                        return <th key={ i } style={col.style || {}} >{ col.name }</th>
                    })
                }
                {
                    remove ? <th style={ {width: "1rem"} }></th> : ''
                }
            </tr>
        </thead>
        <tbody>
        {
            Object.keys(data).map( id => (
                <tr key={ id }>
                    {
                        columns.map(function(col, i) {
                            return <td key={ id + '-' + i } >{ data[id][col.key] }</td>
                        })
                    }
                    {
                        remove ? <td><a className="delete" onClick={ (e) => { remove(id); e.preventDefault(); } }/></td> : ''
                    }
                </tr>
            ) )
        }
        </tbody>
    </table>
);