<commit_before>import React from 'react';

import {
	updateHistoryIfNeeded,
	openModal,
	ModalType,
} from '../../actions';

import {
	Tweet,
} from '../../../shared/models';

import {
	Segment,
	Button,
	Icon,
} from 'semantic-ui-react';

interface ComponentProps {
	tweet: Tweet;
	isRetweet: boolean;

	updateHistoryIfNeeded: typeof updateHistoryIfNeeded;
	openModal: typeof openModal;
}

export class FooterComponent extends React.Component<ComponentProps> {
	constructor(props: ComponentProps) {
		super(props);

		this.handleUpdateHistory = this.handleUpdateHistory.bind(this);
		this.handlePrintJSON = this.handlePrintJSON.bind(this);
	}

	private handleUpdateHistory(id: string) {
		return () => {
			this.props.updateHistoryIfNeeded(id);
		};
	}

	private handlePrintJSON(tweet: Tweet) {
		return () => {
			this.props.openModal(ModalType.MODAL_JSON, tweet);
		};
	}

	public render() {
		const {
			tweet,
			isRetweet,
		} = this.props;

		const {
			retweet_count,
			favorite_count,
			quote_count,
			reply_count,
		} = tweet as any;

		return (
			<Segment className="tweet-footer">
				<Button.Group size="tiny">
					{(() => {
						if(isRetweet === true) {
							return null;
						}
						return (
							<Button onClick={this.handleUpdateHistory(tweet.id_str)} animated="vertical" basic={true} color="grey">
								<Button.Content hidden={true}>read</Button.Content>
								<Button.Content visible={true}>
									<Icon name="sync" />
								</Button.Content>
							</Button>
						);
					})()}
					<Button animated="vertical" basic={true} color="grey">
						<Button.Content hidden={true}>reply</Button.Content>
						<Button.Content visible={true}>
							<Icon name="reply" />
							<span>{reply_count === undefined ? -1 : reply_count}</span>
						</Button.Content>
					</Button>
					<Button animated="vertical" basic={true} color="grey">
						<Button.Content hidden={true}>retweet</Button.Content>
						<Button.Content visible={true}>
							<Icon name="retweet" />
							<span>{retweet_count}</span>
						</Button.Content>
					</Button>
					<Button animated="vertical" basic={true} color="grey">
						<Button.Content hidden={true}>favorite</Button.Content>
						<Button.Content visible={true}>
							<Icon name="star" />
							<span>{favorite_count}</span>
						</Button.Content>
					</Button>
					<Button animated="vertical" basic={true} color="grey">
						<Button.Content hidden={true}>quote</Button.Content>
						<Button.Content visible={true}>
							<Icon name="quote left" />
							<span>{quote_count === undefined ? -1 : quote_count}</span>
						</Button.Content>
					</Button>
					<Button onClick={this.handlePrintJSON(tweet)} animated="vertical" basic={true} color="grey">
						<Button.Content hidden={true}>json</Button.Content>
						<Button.Content visible={true} icon={true}>
							<Icon name="code" />
						</Button.Content>
					</Button>
				</Button.Group>
			</Segment>
		);
	}
}<commit_msg>fix html error<commit_after>import React from 'react';

import {
	updateHistoryIfNeeded,
	openModal,
	ModalType,
} from '../../actions';

import {
	Tweet,
} from '../../../shared/models';

import {
	Segment,
	Button,
	Icon,
} from 'semantic-ui-react';

interface ComponentProps {
	tweet: Tweet;
	isRetweet: boolean;

	updateHistoryIfNeeded: typeof updateHistoryIfNeeded;
	openModal: typeof openModal;
}

export class FooterComponent extends React.Component<ComponentProps> {
	constructor(props: ComponentProps) {
		super(props);

		this.handleUpdateHistory = this.handleUpdateHistory.bind(this);
		this.handlePrintJSON = this.handlePrintJSON.bind(this);
	}

	private handleUpdateHistory(id: string) {
		return () => {
			this.props.updateHistoryIfNeeded(id);
		};
	}

	private handlePrintJSON(tweet: Tweet) {
		return () => {
			this.props.openModal(ModalType.MODAL_JSON, tweet);
		};
	}

	public render() {
		const {
			tweet,
			isRetweet,
		} = this.props;

		const {
			retweet_count,
			favorite_count,
			quote_count,
			reply_count,
		} = tweet as any;

		return (
			<Segment className="tweet-footer">
				<Button.Group size="tiny">
					{(() => {
						if(isRetweet === true) {
							return null;
						}
						return (
							<Button onClick={this.handleUpdateHistory(tweet.id_str)} animated="vertical" basic={true} color="grey">
								<Button.Content hidden={true}>read</Button.Content>
								<Button.Content visible={true}>
									<Icon name="sync" />
								</Button.Content>
							</Button>
						);
					})()}
					<Button animated="vertical" basic={true} color="grey">
						<Button.Content hidden={true}>reply</Button.Content>
						<Button.Content visible={true}>
							<Icon name="reply" />
							<span>{reply_count === undefined ? -1 : reply_count}</span>
						</Button.Content>
					</Button>
					<Button animated="vertical" basic={true} color="grey">
						<Button.Content hidden={true}>retweet</Button.Content>
						<Button.Content visible={true}>
							<Icon name="retweet" />
							<span>{retweet_count}</span>
						</Button.Content>
					</Button>
					<Button animated="vertical" basic={true} color="grey">
						<Button.Content hidden={true}>favorite</Button.Content>
						<Button.Content visible={true}>
							<Icon name="star" />
							<span>{favorite_count}</span>
						</Button.Content>
					</Button>
					<Button animated="vertical" basic={true} color="grey">
						<Button.Content hidden={true}>quote</Button.Content>
						<Button.Content visible={true}>
							<Icon name="quote left" />
							<span>{quote_count === undefined ? -1 : quote_count}</span>
						</Button.Content>
					</Button>
					<Button onClick={this.handlePrintJSON(tweet)} animated="vertical" basic={true} color="grey">
						<Button.Content hidden={true}>json</Button.Content>
						<Button.Content visible={true}>
							<Icon name="code" />
						</Button.Content>
					</Button>
				</Button.Group>
			</Segment>
		);
	}
}
{'fraction_non_alphanumeric': 0.1612358602059767, 'fraction_numerical': 0.0006753334458889077, 'mean_word_length': 3.213371266002845, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 0, '>': 119, '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': '4547459', 'n_tokens_mistral': 2421, 'n_tokens_neox': 1829, 'n_words': 335}