<commit_before>import React, { Component } from 'react';
import { connect } from 'react-redux';
import { fetchPost } from '../actions';
class PostShow extends Component {
    componentDidMount() {
        // React router passes URL param information as the props to the component that is rendered on that route.
        const { id } = this.props.match.params;
        this.props.fetchPost(id);
    }
    
    render() {
        const { post } = this.props;

        /* Initially when the component renders post will be undefined 
           since componentDidMount is executed after first render */
        if(!post){
            return (
                <div>
                    Loading....
                </div>
            );
        }

        return (
            <div>
                <h3>{post.title}</h3>
                <h6>Categories: {post.categories}</h6>
                <p>{post.content}</p>
            </div>
        );
    }<commit_msg>Created Back Link from individual post<commit_after>import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { fetchPost } from '../actions';
class PostShow extends Component {
    componentDidMount() {
        // React router passes URL param information as the props to the component that is rendered on that route.
        const { id } = this.props.match.params;
        this.props.fetchPost(id);
    }
    
    render() {
        const { post } = this.props;

        /* Initially when the component renders post will be undefined 
           since componentDidMount is executed after first render */
        if(!post){
            return (
                <div>
                    Loading....
                </div>
            );
        }

        return (
            <div>
                <Link to="/">Back To Post</Link>
                <h3>{post.title}</h3>
                <h6>Categories: {post.categories}</h6>
                <p>{post.content}</p>
            </div>
        );
    }
{'fraction_non_alphanumeric': 0.11259259259259259, 'fraction_numerical': 0.003950617283950617, 'mean_word_length': 1.5580808080808082, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '3073347', 'n_tokens_mistral': 533, 'n_tokens_neox': 504, 'n_words': 157}