<commit_before>import React, {Component, PropTypes} from 'react'

import FancyScrollbar from 'shared/components/FancyScrollbar'
import LogItemSession from 'src/kapacitor/components/LogItemSession'
import LogItemHTTP from 'src/kapacitor/components/LogItemHTTP'
import LogItemHTTPError from 'src/kapacitor/components/LogItemHTTPError'
import LogItemKapacitorPoint from 'src/kapacitor/components/LogItemKapacitorPoint'
import LogItemKapacitorError from 'src/kapacitor/components/LogItemKapacitorError'
import LogItemKapacitorDebug from 'src/kapacitor/components/LogItemKapacitorDebug'
import LogItemInfluxDBDebug from 'src/kapacitor/components/LogItemInfluxDBDebug'

class LogsTable extends Component {
  constructor(props) {
    super(props)
  }

  renderTableRow = (logItem, index) => {
    if (logItem.service === 'sessions') {
      return <LogItemSession logItem={logItem} key={index} />
    }
    if (logItem.service === 'http' && logItem.msg === 'http request') {
      return <LogItemHTTP logItem={logItem} key={index} />
    }
    if (logItem.service === 'kapacitor' && logItem.msg === 'point') {
      return <LogItemKapacitorPoint logItem={logItem} key={index} />
    }
    if (logItem.service === 'httpd_server_errors' && logItem.lvl === 'error') {
      return <LogItemHTTPError logItem={logItem} key={index} />
    }
    if (logItem.service === 'kapacitor' && logItem.lvl === 'error') {
      return <LogItemKapacitorError logItem={logItem} key={index} />
    }
    if (logItem.service === 'kapacitor' && logItem.lvl === 'debug') {
      return <LogItemKapacitorDebug logItem={logItem} key={index} />
    }
    if (logItem.service === 'influxdb' && logItem.lvl === 'debug') {
      return <LogItemInfluxDBDebug logItem={logItem} key={index} />
    }

    return (
      <div className="logs-table--row" key={index}>
        <div className="logs-table--divider">
          <div className={`logs-table--level ${logItem.lvl}`} />
          <div className="logs-table--timestamp">
            {logItem.ts}
          </div>
        </div>
        <div className="logs-table--details">
          <div className="logs-table--service debug">Thing</div>
          <div className="logs-table--blah">
            <div className="logs-table--key-values">
              <p>Thang</p>
            </div>
          </div>
        </div>
      </div>
    )
  }

  render() {
    const {logs} = this.props

    return (
      <div className="logs-table--container">
        <div className="logs-table--header">
          <h2 className="panel-title">Logs</h2>
        </div>
        <FancyScrollbar
          className="logs-table--panel fancy-scroll--kapacitor"
          autoHide={false}
        >
          <div className="logs-table">
            {logs.length
              ? logs.map((log, i) => this.renderTableRow(log, i))
              : <div className="page-spinner" />}
          </div>
        </FancyScrollbar>
      </div>
    )
  }
}

const {arrayOf, bool, shape, string} = PropTypes

LogsTable.propTypes = {
  isWidget: bool,
  logs: arrayOf(
    shape({
      key: string.isRequired,
      ts: string.isRequired,
      lvl: string.isRequired,
      msg: string.isRequired,
    })
  ).isRequired,
}

export default LogsTable<commit_msg>Remove unused prop<commit_after>import React, {Component, PropTypes} from 'react'

import FancyScrollbar from 'shared/components/FancyScrollbar'
import LogItemSession from 'src/kapacitor/components/LogItemSession'
import LogItemHTTP from 'src/kapacitor/components/LogItemHTTP'
import LogItemHTTPError from 'src/kapacitor/components/LogItemHTTPError'
import LogItemKapacitorPoint from 'src/kapacitor/components/LogItemKapacitorPoint'
import LogItemKapacitorError from 'src/kapacitor/components/LogItemKapacitorError'
import LogItemKapacitorDebug from 'src/kapacitor/components/LogItemKapacitorDebug'
import LogItemInfluxDBDebug from 'src/kapacitor/components/LogItemInfluxDBDebug'

class LogsTable extends Component {
  constructor(props) {
    super(props)
  }

  renderTableRow = (logItem, index) => {
    if (logItem.service === 'sessions') {
      return <LogItemSession logItem={logItem} key={index} />
    }
    if (logItem.service === 'http' && logItem.msg === 'http request') {
      return <LogItemHTTP logItem={logItem} key={index} />
    }
    if (logItem.service === 'kapacitor' && logItem.msg === 'point') {
      return <LogItemKapacitorPoint logItem={logItem} key={index} />
    }
    if (logItem.service === 'httpd_server_errors' && logItem.lvl === 'error') {
      return <LogItemHTTPError logItem={logItem} key={index} />
    }
    if (logItem.service === 'kapacitor' && logItem.lvl === 'error') {
      return <LogItemKapacitorError logItem={logItem} key={index} />
    }
    if (logItem.service === 'kapacitor' && logItem.lvl === 'debug') {
      return <LogItemKapacitorDebug logItem={logItem} key={index} />
    }
    if (logItem.service === 'influxdb' && logItem.lvl === 'debug') {
      return <LogItemInfluxDBDebug logItem={logItem} key={index} />
    }

    return (
      <div className="logs-table--row" key={index}>
        <div className="logs-table--divider">
          <div className={`logs-table--level ${logItem.lvl}`} />
          <div className="logs-table--timestamp">
            {logItem.ts}
          </div>
        </div>
        <div className="logs-table--details">
          <div className="logs-table--service debug">Thing</div>
          <div className="logs-table--blah">
            <div className="logs-table--key-values">
              <p>Thang</p>
            </div>
          </div>
        </div>
      </div>
    )
  }

  render() {
    const {logs} = this.props

    return (
      <div className="logs-table--container">
        <div className="logs-table--header">
          <h2 className="panel-title">Logs</h2>
        </div>
        <FancyScrollbar
          className="logs-table--panel fancy-scroll--kapacitor"
          autoHide={false}
        >
          <div className="logs-table">
            {logs.length
              ? logs.map((log, i) => this.renderTableRow(log, i))
              : <div className="page-spinner" />}
          </div>
        </FancyScrollbar>
      </div>
    )
  }
}

const {arrayOf, shape, string} = PropTypes

LogsTable.propTypes = {
  logs: arrayOf(
    shape({
      key: string.isRequired,
      ts: string.isRequired,
      lvl: string.isRequired,
      msg: string.isRequired,
    })
  ).isRequired,
}

export default LogsTable
{'fraction_non_alphanumeric': 0.14643575073449822, 'fraction_numerical': 0.0006185248183083346, 'mean_word_length': 2.85, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3004100', 'n_tokens_mistral': 2050, 'n_tokens_neox': 2065, 'n_words': 376}