<commit_before>'use strict'
import React from 'react'
import PropTypes from 'prop-types'
import Row from '../Mixin/List/Row.jsx'
import moment from 'moment'

export default class PropertyRow extends Row {
  constructor(props) {
    super(props)
  }

  getRent() {
    let rent = `\$ ${this.props.property.monthly_rent} ${this.props.property.lease_type}`
    return rent
  }

  workout() {
    if (this.props.property.workout_room === '1') {
      return (
        <span
          className="fa-3x amenity-icon"
          data-placement="top"
          data-tip="Workout room on premises">
          <i
            className="fas fa-heartbeat"
            data-fa-transform="shrink-8"
            data-fa-mask="fas fa-square"></i>
        </span>
      )
    }
  }

  clubhouse() {
    if (this.props.property.clubhouse === '1') {
      return (
        <span
          className="fa-3x amenity-icon"
          data-placement="top"
          data-tip="Clubhouse on premises">
          <i
            className="fas fa-coffee"
            data-fa-transform="shrink-8"
            data-fa-mask="fas fa-square"></i>
        </span>
      )
    }
  }

  pool() {
    if (this.props.property.pool === '1') {
      return (
        <span
          className="fa-3x amenity-icon"
          data-placement="top"
          data-tip="Swimming pool on premises">
          <i
            className="fas fa-life-ring"
            data-fa-transform="shrink-8"
            data-fa-mask="fas fa-square"></i>
        </span>
      )
    }
  }

  render() {
    const {property} = this.props
    const link = `./properties/Property/${property.id}/${this.urlTitle(
      property.name
    )}`
    let image = (
      <div
        className="text-muted d-flex align-items-center flex-column justify-content-center h-100">
        <div>
          <i className="fa fa-camera fa-5x"></i>
        </div>
        <div>No photos available</div>
      </div>
    )
    if (property.thumbnail !== '') {
      const thumbStyle = {
        backgroundImage: `url('${property.thumbnail}')`
      }
      image = <div className="property-thumbnail" style={thumbStyle}></div>
    }

    let timeout
    let titleClass
    if (property.active !== undefined && property.active === '0') {
      titleClass = 'title deactive'
      if (this.props.showTimeout) {
        timeout = (
          <button className="btn btn-primary" onClick={this.props.reactivate}>Reactivate</button>
        )
      }
    } else {
      if (this.props.showTimeout) {
        const inactiveDate = moment(property.timeout * 1000).format('MMM D, YYYY')
        timeout = (
          <div className="mt-1">
            <p>
              <em>This property will be flagged inactive after {inactiveDate}. Update to reset timer.</em>
            </p>
          </div>
        )
      }
      titleClass = 'title active'
    }

    return (
      <div className="row property-row">
        <div className="col-sm-4 img-column">
          <a href={link}>{image}</a>
        </div>
        <div className="col-sm-8">
          <h4 className={titleClass}>
            <a href={link}>{property.name}</a>
          </h4>
          <div className="row">
            <div className="col-md-8">
              <div className="rent">{this.getRent()}</div>
              <div className="room-bath">{property.proptype}&nbsp; - {property.bedroom_no}&nbsp;Bed, {property.bathroom_no}&nbsp;Bath
              </div>
              <div className="availability">Availability: {property.move_in_date}</div>
            </div>
            <div className="col-md-4">
              <div className="icon-listing">
                {this.smoking(property.smoke_free)}<commit_msg>Added more margin to the top of alert.<commit_after>'use strict'
import React from 'react'
import PropTypes from 'prop-types'
import Row from '../Mixin/List/Row.jsx'
import moment from 'moment'

export default class PropertyRow extends Row {
  constructor(props) {
    super(props)
  }

  getRent() {
    let rent = `\$ ${this.props.property.monthly_rent} ${this.props.property.lease_type}`
    return rent
  }

  workout() {
    if (this.props.property.workout_room === '1') {
      return (
        <span
          className="fa-3x amenity-icon"
          data-placement="top"
          data-tip="Workout room on premises">
          <i
            className="fas fa-heartbeat"
            data-fa-transform="shrink-8"
            data-fa-mask="fas fa-square"></i>
        </span>
      )
    }
  }

  clubhouse() {
    if (this.props.property.clubhouse === '1') {
      return (
        <span
          className="fa-3x amenity-icon"
          data-placement="top"
          data-tip="Clubhouse on premises">
          <i
            className="fas fa-coffee"
            data-fa-transform="shrink-8"
            data-fa-mask="fas fa-square"></i>
        </span>
      )
    }
  }

  pool() {
    if (this.props.property.pool === '1') {
      return (
        <span
          className="fa-3x amenity-icon"
          data-placement="top"
          data-tip="Swimming pool on premises">
          <i
            className="fas fa-life-ring"
            data-fa-transform="shrink-8"
            data-fa-mask="fas fa-square"></i>
        </span>
      )
    }
  }

  render() {
    const {property} = this.props
    const link = `./properties/Property/${property.id}/${this.urlTitle(
      property.name
    )}`
    let image = (
      <div
        className="text-muted d-flex align-items-center flex-column justify-content-center h-100">
        <div>
          <i className="fa fa-camera fa-5x"></i>
        </div>
        <div>No photos available</div>
      </div>
    )
    if (property.thumbnail !== '') {
      const thumbStyle = {
        backgroundImage: `url('${property.thumbnail}')`
      }
      image = <div className="property-thumbnail" style={thumbStyle}></div>
    }

    let timeout
    let titleClass
    if (property.active !== undefined && property.active === '0') {
      titleClass = 'title deactive'
      if (this.props.showTimeout) {
        timeout = (
          <button className="btn btn-primary" onClick={this.props.reactivate}>Reactivate</button>
        )
      }
    } else {
      if (this.props.showTimeout) {
        const inactiveDate = moment(property.timeout * 1000).format('MMM D, YYYY')
        timeout = (
          <div className="mt-2">
            <p>
              <em>This property will be flagged inactive after {inactiveDate}. Update to reset timer.</em>
            </p>
          </div>
        )
      }
      titleClass = 'title active'
    }

    return (
      <div className="row property-row">
        <div className="col-sm-4 img-column">
          <a href={link}>{image}</a>
        </div>
        <div className="col-sm-8">
          <h4 className={titleClass}>
            <a href={link}>{property.name}</a>
          </h4>
          <div className="row">
            <div className="col-md-8">
              <div className="rent">{this.getRent()}</div>
              <div className="room-bath">{property.proptype}&nbsp; - {property.bedroom_no}&nbsp;Bed, {property.bathroom_no}&nbsp;Bath
              </div>
              <div className="availability">Availability: {property.move_in_date}</div>
            </div>
            <div className="col-md-4">
              <div className="icon-listing">
                {this.smoking(property.smoke_free)}
{'fraction_non_alphanumeric': 0.14899365122247737, 'fraction_numerical': 0.0067540186410914495, 'mean_word_length': 1.8798133022170362, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 105, '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': '4494463', 'n_tokens_mistral': 2290, 'n_tokens_neox': 2247, 'n_words': 436}