<commit_before>import React from 'react'
import { Link } from 'react-router'

import List from 'material-ui/lib/lists/list';
import ListItem from 'material-ui/lib/lists/list-item';

export class SearchResult extends React.Component {
    render() {
        var innerDivStyle = {
          paddingLeft: "4rem"
        };

        var building = null;
        if (this.props.result.building) {
            var buildingUrl = '/list?building=' + encodeURIComponent(this.props.result.building)
            var buildingLink = <Link to={buildingUrl} />
            building = <ListItem containerElement={buildingLink} innerDivStyle={innerDivStyle}
              primaryText={this.props.result.building} leftIcon={<i className="material-icons">account_balance</i>} />
        }

        var room = null;
        if (this.props.result.room) {
            var roomUrl = '/list?building=' + encodeURIComponent(this.props.result.building) + '&room=' + encodeURIComponent(this.props.result.room)
            var roomLink = <Link to={roomUrl} />
            room = <ListItem containerElement={roomLink} innerDivStyle={innerDivStyle}
              primaryText={this.props.result.room} leftIcon={<i className="material-icons">hotel</i>} />
        }

        var department = null;
        if (this.props.result.department) {
            var departmentUrl = '/list?department=' + encodeURIComponent(this.props.result.department)
            var departmentLink = <Link to={departmentUrl} />
            department = <ListItem containerElement={departmentLink} innerDivStyle={innerDivStyle}
              primaryText={this.props.result.department} leftIcon={<i className="material-icons">group</i>} />
        }

        var vlan = null;
        if (this.props.result.vlan) {
            var vlanUrl = '/list?vlan=' + encodeURIComponent(this.props.result.vlan)
            var vlanLink = <Link to={vlanUrl} />
            vlan = <ListItem containerElement={vlanLink} innerDivStyle={innerDivStyle}
              primaryText={this.props.result.vlan} leftIcon={<i className="material-icons">router</i>} />
        }

        return (
            <div className="result col-sm-6">
              <div className="card">
                <h4 className="card-header" style={{position: "relative"}}>
                  <i className="material-icons" style={{position: "absolute"}}>settings_input_hdmi</i>
                  <span style={{paddingLeft: "2rem"}}>{this.props.result.namNumber}</span></h4>
                <div className="card-block">
                  <List>
                    {building}
                    {room}
                    {department}
                    {vlan}
                  </List>
                </div>
              </div>
            </div>
        )
    }
}

export class SearchResultList extends React.Component {
    render() {
        return (
            <div className="row">
              {this.props.results.map(function(result) {
                 return (
                    <SearchResult key={result.NamNumber} result={result} />
                 )
              })}
            </div>
        )
    }
}<commit_msg>tweak<commit_after>import React from 'react';
import { Link } from 'react-router';

import List from 'material-ui/lib/lists/list';
import ListItem from 'material-ui/lib/lists/list-item';

export class SearchResult extends React.Component {
    render() {
        var building = null;
        if (this.props.result.building) {
            var buildingUrl = '/list?building=' + encodeURIComponent(this.props.result.building)
            var buildingLink = <Link to={buildingUrl} />
            building = <ListItem containerElement={buildingLink} innerDivStyle={styles.result}
              primaryText={this.props.result.building} leftIcon={<i className="material-icons">account_balance</i>} />
        }

        var room = null;
        if (this.props.result.room) {
            var roomUrl = '/list?building=' + encodeURIComponent(this.props.result.building) + '&room=' + encodeURIComponent(this.props.result.room)
            var roomLink = <Link to={roomUrl} />
            room = <ListItem containerElement={roomLink} innerDivStyle={styles.result}
              primaryText={this.props.result.room} leftIcon={<i className="material-icons">hotel</i>} />
        }

        var department = null;
        if (this.props.result.department) {
            var departmentUrl = '/list?department=' + encodeURIComponent(this.props.result.department)
            var departmentLink = <Link to={departmentUrl} />
            department = <ListItem containerElement={departmentLink} innerDivStyle={styles.result}
              primaryText={this.props.result.department} leftIcon={<i className="material-icons">group</i>} />
        }

        var vlan = null;
        if (this.props.result.vlan) {
            var vlanUrl = '/list?vlan=' + encodeURIComponent(this.props.result.vlan)
            var vlanLink = <Link to={vlanUrl} />
            vlan = <ListItem containerElement={vlanLink} innerDivStyle={styles.result}
              primaryText={this.props.result.vlan} leftIcon={<i className="material-icons">router</i>} />
        }

        return (
            <div className="result col-sm-6">
              <div className="card">
                <h4 className="card-header" style={{position: "relative"}}>
                  <i className="material-icons" style={{position: "absolute"}}>settings_input_hdmi</i>
                  <span style={styles.result}>{this.props.result.namNumber}</span></h4>
                <div className="card-block">
                  <List>
                    {building}
                    {room}
                    {department}
                    {vlan}
                  </List>
                </div>
              </div>
            </div>
        )
    }
}

export class SearchResultList extends React.Component {
  render() {
    return (
      <div className="row">
        {this.props.results.map((result) => <SearchResult key={result.NamNumber} result={result} />)}
      </div>
    );
  }
}

const styles = {
  searchResult: {
    innerDiv: {
      paddingLeft: '4rem'
    }
  }
};
{'fraction_non_alphanumeric': 0.13373415664608385, 'fraction_numerical': 0.0014624634384140397, 'mean_word_length': 2.1133029843196764, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 70, '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': '3823364', 'n_tokens_mistral': 1713, 'n_tokens_neox': 1691, 'n_words': 302}