<commit_before>import React, { Component } from 'react';

class DMList extends Component{
    constructor(props){
        super(props);
        this.state = {

        }
    }

    render(){
        return(
            <h1>Your Inbox</h1>
        )
    }
}

export default DMList;<commit_msg>dmlist<commit_after>import React, { Component } from 'react';
import axios from 'axios';

import Message from './Message';

class DMList extends Component {

constructor(props) {
    super(props);
     this.state= {
        apiDataLoaded: false,
        apiData: null,
     }
}

componentDidMount() {
    axios.get(`/messages`)
    .then(res => {
        this.setState ({
            apiDataLoaded: true,
            apiData: res.data.data,
        })
    })
}

renderMessages() {
    if (this.state.apiDataLoaded) {
        return this.state.apiData.map(messages => {
            return (
                <Messages key={messages.id} messages={messages} />
            );
        });
    } else return <p>Loading...</p>
}

    render(){
        return (
       <div className="Dm-list">
           {this.renderMessages()}
       </div>
        )
    }
}

export default DMList;
{'fraction_non_alphanumeric': 0.13515825491873396, 'fraction_numerical': 0.001710863986313088, 'mean_word_length': 1.8746928746928746, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, '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': '5503268', 'n_tokens_mistral': 355, 'n_tokens_neox': 352, 'n_words': 71}