<commit_before>import React from "react";
import { Link } from "react-router";
import Loader from "../../core/Loader";
import DataComponent from "./../base/DataComponent";
import DataError from "./../base/DataError";
import ResourceAction from "./../base/ResourceAction";
import history from "../../history";

/**
 * @author <NAME>
 */
class TemplateDetail extends DataComponent {
    getDataUri() {
        return "templates/" + this.props.params.id;
    }

    componentWillReceiveProps(next) {
        let oldId = this.props.params.id;
        let newId = next.params.id;

        if (oldId !== newId) {
            this.fetchData();
        }
    }

    render() {
        let content = null;

        if (this.state.loaded) {
            if (this.state.failed) {
                content = (
                    <DataError />
                );
            } else {
                let type;

                if ("answerType" in this.state.data) {
                    type = (
                        <span>
                            <i className="fa fa-file-image-o icon"/>
                            Image
                        </span>
                    );
                } else {<commit_msg>Fix answer type display in templates<commit_after>import React from "react";
import { Link } from "react-router";
import Loader from "../../core/Loader";
import DataComponent from "./../base/DataComponent";
import DataError from "./../base/DataError";
import ResourceAction from "./../base/ResourceAction";
import history from "../../history";

/**
 * @author <NAME>
 */
class TemplateDetail extends DataComponent {
    getDataUri() {
        return "templates/" + this.props.params.id;
    }

    componentWillReceiveProps(next) {
        let oldId = this.props.params.id;
        let newId = next.params.id;

        if (oldId !== newId) {
            this.fetchData();
        }
    }

    render() {
        let content = null;

        if (this.state.loaded) {
            if (this.state.failed) {
                content = (
                    <DataError />
                );
            } else {
                let type;

                if ("answerType" in this.state.data && this.state.data.answerType === "IMAGE") {
                    type = (
                        <span>
                            <i className="fa fa-file-image-o icon"/>
                            Image
                        </span>
                    );
                } else {
{'fraction_non_alphanumeric': 0.12999596285829632, 'fraction_numerical': 0.0, 'mean_word_length': 1.3267605633802817, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '6604855', 'n_tokens_mistral': 650, 'n_tokens_neox': 621, 'n_words': 157}