<commit_before>'use strict'

import React from 'react'
import LazyImg from './lazy-img'

const EventListItem = () => (
  <article className='event'>
    <a className='event-media' href='inner.html' title='Ver evento'>
      <LazyImg src='http://www.conferenciacssbrasil.com.br/build/img/css-brasil.png' alt='Conferência CSS Brasil' />
    </a>
    <div className='event-main'>
      <a className='content' href='inner.html' title='Ver evento'>
        <h2>Conferência CSS Brasil</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti vero assumenda aliquid voluptatibus quos vitae ratione aut maiores quo odio.</p>
      </a>
      <a className='btn-link' href='http://www.conferenciacssbrasil.com.br/' target='_blank' title='Visitar site oficial'>
        <svg className='icon' aria-hidden='true' aria-label='Link'><use xlinkHref='svg/icons.svg#link' /></svg>
        conferenciacssbrasil.com.br
      </a>
      <ul className='event-list'>
        <li className='event-list--item'>
          <svg className='icon' aria-hidden='true' aria-label='Data'><use xlinkHref='svg/icons.svg#date' /></svg>
          19/03/2016
        </li>
        <li className='event-list--item'>
          <svg className='icon' aria-hidden='true' aria-label='Preço'><use xlinkHref='svg/icons.svg#price'/></svg>
          R$ 120,00
        </li>
        <li className='event-list--item'>
          <svg className='icon' aria-hidden='true' aria-label='Local'><use xlinkHref='svg/icons.svg#location'/></svg>
          <a href='https://www.google.com.br/maps?q=maksoud+plaza&um=1&ie=UTF-8&sa=X&ved=0ahUKEwinuq_pm4rMAhXKkZAKHfMfBgoQ_AUICCgC' target='_blank'>Maksound Plaza, São Paulo - SP</a>
        </li>
      </ul>
    </div>
  </article>
)

EventListItem.defaultProps = {

}

EventListItem.propTypes = {

}

export default EventListItem<commit_msg>Update event list item component<commit_after>'use strict'

import React, { PropTypes } from 'react'
import LazyImg from './lazy-img'
import SvgIcon from './svg-icon'

const getMonth = (month) => {
  const months = [
    'Janeiro',
    'Fevereiro',
    'Março',
    'Abril',
    'Maio',
    'Junho',
    'Julho',
    'Agosto',
    'Setembro',
    'Outubro',
    'Novembro',
    'Dezembro'
  ]
  const m = months.indexOf(month) + 1
  return (m < 10 ? '0' : '') + m
}

const formatDate = ({ day, month, year }) => {
  return `${day}/${getMonth(month)}/${year}`
}

const EventListItem = ({
  title,
  image,
  innerLink,
  link,
  date,
  price,
  location,
  locationUrl,
  shortDescription
}) => (
  <article className='event'>
    <a className='event-media' href={innerLink} title='Ver evento'>
      <LazyImg src={image || '/svg/logo.svg'} alt={title} />
    </a>
    <div className='event-main'>
      <a className='content' href={innerLink} title='Ver evento'>
        <h2>{title}</h2>
        <p>{shortDescription}</p>
      </a>
      {!!link &&
        <a className='btn-link' href={link} target='_blank' title='Visitar site oficial'>
          <SvgIcon id='link' label='Link' />
          {link.replace(/^http:\/\/(?:www.)?(.+?)\/$/, '$1')}
        </a>
      }
      <ul className='event-list'>
        <li className='event-list--item'>
          <SvgIcon id='date' label='Data' />
          {formatDate(date)}
        </li>
        <li className='event-list--item'>
          <SvgIcon id='price' label='Preço' />
          {price}
        </li>
        {!!locationUrl &&
          <li className='event-list--item'>
            <SvgIcon id='location' label='Local' />
            <a href={locationUrl} target='_blank'>{location}</a>
          </li>
        }
      </ul>
    </div>
  </article>
)

EventListItem.defaultProps = {
  date: {
    day: '00',
    month: 'xx',
    year: '0000'
  },
  price: 'Grátis'
}

EventListItem.propTypes = {
  title: PropTypes.string.isRequired,
  image: PropTypes.string,
  innerLink: PropTypes.string.isRequired,
  link: PropTypes.string,
  date: PropTypes.shape({
    day: PropTypes.number.isRequired,
    month: PropTypes.string.isRequired,
    year: PropTypes.number.isRequired
  }).isRequired,
  price: PropTypes.string,
  location: PropTypes.string,
  locationUrl: PropTypes.string,
  shortDescription: PropTypes.string.isRequired
}

export default EventListItem
{'fraction_non_alphanumeric': 0.17369901547116737, 'fraction_numerical': 0.007501172058134084, 'mean_word_length': 2.9146788990825687, 'pattern_counts': {'":': 0, '<': 70, '<?xml version=': 0, '>': 73, 'https://': 1, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7642792', 'n_tokens_mistral': 1490, 'n_tokens_neox': 1479, 'n_words': 282}