<commit_before>import React from 'react';
import PropTypes from 'prop-types';

import { pages } from '../../../app.config';
import PortfolioItemShape from '../../prop-types/PortfolioItem';
import Default from '../../components/Layouts/Default';

const { items, route } = pages.portfolio;
const getPortfolioItem = slug => items.find(item => item.slug === slug);

export const PortfolioItem = ({
	slug,
	portfolioItem = getPortfolioItem(slug),
	className
}) => (
	<Choose>
		<When condition={portfolioItem}>
			<Default
				route={Object.assign({}, route, {
					label: portfolioItem.label,
					title: `${route.title} | ${portfolioItem.label}`,
					description: portfolioItem.description
				})}
				className={className}
			>
				<div>{portfolioItem.label}</div>
				<div>{portfolioItem.description}</div>
				<img src={portfolioItem.image} alt={portfolioItem.label} />
			</Default>
		</When>
		<Otherwise>
			<Default
				route={Object.assign({}, route, {
					label: `${slug} not found`,
					title: `${route.title} | ${slug} not found`
				})}
				className={className}
			/>
		</Otherwise>
	</Choose>
);

PortfolioItem.propTypes = {<commit_msg>fix display image on portfolioItem page<commit_after>import React from 'react';
import PropTypes from 'prop-types';

import { pages } from '../../../app.config';
import PortfolioItemShape from '../../prop-types/PortfolioItem';
import Default from '../../components/Layouts/Default';

const { items, route } = pages.portfolio;
const getPortfolioItem = slug => items.find(item => item.slug === slug);

export const PortfolioItem = ({
	slug,
	portfolioItem = getPortfolioItem(slug),
	className
}) => (
	<Choose>
		<When condition={portfolioItem}>
			<Default
				route={Object.assign({}, route, {
					label: portfolioItem.label,
					title: `${route.title} | ${portfolioItem.label}`,
					description: portfolioItem.description
				})}
				className={className}
			>
				<img src={portfolioItem.images[0]} alt={portfolioItem.label} />
				<div>{portfolioItem.label}</div>
				<div>{portfolioItem.description}</div>
			</Default>
		</When>
		<Otherwise>
			<Default
				route={Object.assign({}, route, {
					label: `${slug} not found`,
					title: `${route.title} | ${slug} not found`
				})}
				className={className}
			/>
		</Otherwise>
	</Choose>
);

PortfolioItem.propTypes = {
{'fraction_non_alphanumeric': 0.17510729613733905, 'fraction_numerical': 0.00042918454935622315, 'mean_word_length': 3.7186234817813766, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 37, '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': '2731438', 'n_tokens_mistral': 839, 'n_tokens_neox': 728, 'n_words': 155}