<commit_before>import React, { Component } from 'react'
import * as actionCreators from '../action-creators'
import {connect} from 'react-redux'
import Navlink from './navlink.jsx'
import Navbar from './navbar.jsx'
import updateServer from '../helpers/update-server.js'
var Swipeable = require('react-swipeable')

export default class Shortlist extends Component {
	constructor(props) {
		super(props)
	}

	handleClick(restaurant) {
		updateServer(this.props.shortlist, restaurant, 'remove')
		this.props.removeFromShortList(restaurant.id)
	}

	showRestaurant(restaurant) {
		this.props.showRestaurant(restaurant)
	}


	render () {
		const shortlist = this.props.shortlist.restaurants

		return (
			<div>
				<Navbar/>
				<main id='shortlist'>
				{
					!(shortlist) ? null : shortlist.map((restaurant) => {
						return (
							<Swipeable  
								delta={50} 
								onSwipedLeft={	() => this.handleClick(restaurant) } >
								<div	className="shortlist-restaurant">
									<Navlink to="/">
										<img 
											className="SL-item" 
											src={restaurant.photo} 
											onClick={()=> this.showRestaurant(restaurant)}/>
									</Navlink>
									<h6  className="SL-detail">{restaurant.name}</h6>
									<button 
										className="SL-item remove-restaurant" 
										onClick={()=>{this.handleClick(restaurant)}}>
											Remove
									</button>
								</div>
						</Swipeable>)

					})
				}
				</main>
			</div>
		)
	}
}

const mapStateToProps =  (state) => {
  return {
    shortlist: state.ShortList
  }
}

export const ShortlistContainer = connect(
  mapStateToProps, 
  actionCreators
  )(Shortlist)

<commit_msg>empty shortlist showing p tag saying nothing in short list<commit_after>import React, { Component } from 'react'
import * as actionCreators from '../action-creators'
import {connect} from 'react-redux'
import Navlink from './navlink.jsx'
import Navbar from './navbar.jsx'
import updateServer from '../helpers/update-server.js'
var Swipeable = require('react-swipeable')

export default class Shortlist extends Component {
	constructor(props) {
		super(props)
	}

	handleClick(restaurant) {
		updateServer(this.props.shortlist, restaurant, 'remove')
		this.props.removeFromShortList(restaurant.id)
	}

	showRestaurant(restaurant) {
		this.props.showRestaurant(restaurant)
	}


	render () {
		const shortlist = this.props.shortlist.restaurants
		if (shortlist.length===0) {
			console.log('nothing in shortlist')
			return (
				<div>
					<Navbar/>
					<main id='shortlist'>
						<p>Nothing in your shorty yet</p>
					</main>
				</div>
				)
		} else {
			return (
				<div>
					<Navbar/>
					<main id='shortlist'>
					{shortlist.map((restaurant) => {
						return (
							<Swipeable  
							delta={50} 
							onSwipedLeft={	() => this.handleClick(restaurant) } >
							<div	className="shortlist-restaurant">
								<Navlink to="/">
									<img 
										className="SL-item" 
										src={restaurant.photo} 
										onClick={()=> this.showRestaurant(restaurant)}/>
								</Navlink>
								<h6  className="SL-detail">{restaurant.name}</h6>
								<button 
									className="SL-item remove-restaurant" 
									onClick={()=>{this.handleClick(restaurant)}}>
										Remove
								</button>
							</div>
						</Swipeable>
						)
					})}
						
					</main>
				</div>)
		}
	}
}

const mapStateToProps =  (state) => {
  return {
    shortlist: state.ShortList
  }
}

export const ShortlistContainer = connect(
  mapStateToProps, 
  actionCreators
  )(Shortlist)


{'fraction_non_alphanumeric': 0.13830985915492958, 'fraction_numerical': 0.0025352112676056337, 'mean_word_length': 2.691268191268191, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 52, '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': '7126735', 'n_tokens_mistral': 1580, 'n_tokens_neox': 1142, 'n_words': 217}