<commit_before>import React from 'react'
import { provideHooks } from 'redial'
import { reduxForm } from 'redux-form'
import Loader from 'react-loaders'
import { viewTodo } from '../actions';
import { connect } from 'react-redux';
import { TodoUpdateForm } from './TodoForm';
import { Link } from 'react-router'

@provideHooks({
  fetch: ({ dispatch, params: { id }, store }) => dispatch(
    viewTodo({
      id: id,
      reject: (e) => {alert(e.message);},
      store
    }))
})
@connect((state) => {
  return {
    viewedTodo: state.todo.viewedTodo,
    fetchState: state.todo.fetchState,
  };
})
export default class TodoDetail extends React.Component {
  render() {
    const { viewedTodo, fetchState, history } = this.props;
    if (fetchState[viewTodo].fetching) {
      return (
        <div className="todo-detail">
          <div key="loader" className="loader">
            <Loader type="line-scale" active="true"/>
          </div>
        </div>
      )
    }
    if (!viewedTodo) {
      return <div className="todo-detail"/><commit_msg>Fix error message on fetching in todo detail page<commit_after>import React from 'react'
import { provideHooks } from 'redial'
import { reduxForm } from 'redux-form'
import Loader from 'react-loaders'
import { viewTodo } from '../actions';
import { connect } from 'react-redux';
import { TodoUpdateForm } from './TodoForm';
import { Link } from 'react-router'

@provideHooks({
  fetch: ({ dispatch, params: { id }, store }) => dispatch(
    viewTodo({
      id: id,
      reject: (e) => {alert(e);},
      store
    }))
})
@connect((state) => {
  return {
    viewedTodo: state.todo.viewedTodo,
    fetchState: state.todo.fetchState,
  };
})
export default class TodoDetail extends React.Component {
  render() {
    const { viewedTodo, fetchState, history } = this.props;
    if (fetchState[viewTodo].fetching) {
      return (
        <div className="todo-detail">
          <div key="loader" className="loader">
            <Loader type="line-scale" active="true"/>
          </div>
        </div>
      )
    }
    if (!viewedTodo) {
      return <div className="todo-detail"/>
{'fraction_non_alphanumeric': 0.1513589503280225, 'fraction_numerical': 0.0, 'mean_word_length': 2.9684014869888475, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 21, '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': '3213237', 'n_tokens_mistral': 680, 'n_tokens_neox': 677, 'n_words': 171}