{"size": 578, "ext": "js", "max_stars_repo_path": "src/components/StocksTable/TableRows.js", "max_stars_repo_name": "jraleman/stonks", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/StocksTable/TableRows.js", "max_issues_repo_name": "jraleman/stonks", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/StocksTable/TableRows.js", "max_forks_repo_name": "jraleman/stonks", "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": 24.0833333333, "max_line_length": 72, "alphanum_fraction": 0.5363321799}
import React from 'react';
import styled from 'styled-components';

const StyledRow = styled.tr`
    cursor: pointer;
`;

const TableRows = ({ rows, prepareRow, onClick }) => rows.map((row) => {
    const handleOnClick = () => onClick(row.original);
    
    prepareRow(row);
    return (
        <StyledRow {...row.getRowProps()} onClick={handleOnClick}>
            {row.cells.map(cell => (
                <td {...cell.getCellProps()}>
                    {cell.render("Cell")}
                </td>
            ))}
        </StyledRow>
    );
});

export default TableRows;
