{"size": 737, "ext": "js", "max_stars_repo_path": "images/03-ui/src/routes/dashboard/components/eventLogs.js", "max_stars_repo_name": "liyimeng/k8svm", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "images/03-ui/src/routes/dashboard/components/eventLogs.js", "max_issues_repo_name": "liyimeng/k8svm", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "images/03-ui/src/routes/dashboard/components/eventLogs.js", "max_forks_repo_name": "liyimeng/k8svm", "max_forks_repo_forks_event_min_datetime": "2021-01-23T09:29:33.000Z", "max_forks_repo_forks_event_max_datetime": "2021-01-23T09:29:33.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 27.2962962963, "max_line_length": 159, "alphanum_fraction": 0.6295793758}
import React, { PropTypes } from 'react'
import { Table } from 'antd'
import classnames from 'classnames'
import styles from './eventLogs.less'

function EventLogs({ data }) {
  const columns = [
    {
      title: 'date',
      dataIndex: 'date',
      className: styles.date,
    }, {
      title: 'text',
      dataIndex: 'text',
      className: styles.text,
      render: (text, record) => <span className={classnames({ [styles.info]: record.type === 'info', [styles.error]: record.type === 'error' })}>{text}</span>,
    },
  ]
  return <Table pagination={false} showHeader={false} columns={columns} rowKey={(record, key) => key} dataSource={data} />
}

EventLogs.propTypes = {
  data: PropTypes.array,
}

export default EventLogs
