<commit_before>// @flow
import React, {Component} from 'react';
import CSSModules from 'react-css-modules';
import {rankingModes} from '../../contains';
import type {query} from '../../actions/column';
import styles from './select-column-modal.css';


class Link extends Component {
	props: {
		onSelect: (mode: string) => void,
		mode: string
	};

	shouldComponentUpdate() {
		return false;
	}

	render() {
		return (
			<li>
				<a onClick={() => this.props.onSelect(this.props.mode)}>
					{`ranking/${this.props.mode}`}
				</a>
			</li>
		);
	}
}

type Props = {
	onSelect: (query: query, title: string) => void
};

@CSSModules(styles)
export default class SelectColumnModal extends Component {
	props: Props;

	handleAddRanking = (mode: string) => {
		this.props.onSelect({type: 'ranking', opts: {mode, page: 1}}, `ranking/${mode}`);
	}

	handleAddFavorite = (publicity: string) => {
		this.props.onSelect({type: 'favoriteWorks', opts: {publicity, page: 1}}, `favorite/${publicity}`);
	};

	render() {
		const rankingLinks = rankingModes.map(v =>
			<Link
				mode={v}
				key={v}
				onSelect={this.handleAddRanking}<commit_msg>Add type<commit_after>// @flow
import React, {Component} from 'react';
import CSSModules from 'react-css-modules';
import {rankingModes} from '../../contains';
import type {query} from '../../actions/column';
import styles from './select-column-modal.css';


class Link extends Component {
	props: {
		onSelect: (mode: string) => void,
		mode: string
	};

	shouldComponentUpdate() {
		return false;
	}

	render() {
		return (
			<li>
				<a onClick={() => this.props.onSelect(this.props.mode)}>
					{`ranking/${this.props.mode}`}
				</a>
			</li>
		);
	}
}

type Props = {
	onSelect: (query: query, title: string) => void
};

@CSSModules(styles)
export default class SelectColumnModal extends Component {
	props: Props;

	handleAddRanking = (mode: string) => {
		this.props.onSelect({type: 'ranking', opts: {mode, page: 1}}, `ranking/${mode}`);
	}

	handleAddFavorite = (publicity: 'private' | 'public') => {
		this.props.onSelect({type: 'favoriteWorks', opts: {publicity, page: 1}}, `favorite/${publicity}`);
	}

	render() {
		const rankingLinks = rankingModes.map(v =>
			<Link
				mode={v}
				key={v}
				onSelect={this.handleAddRanking}
{'fraction_non_alphanumeric': 0.18349429323968394, 'fraction_numerical': 0.001755926251097454, 'mean_word_length': 3.9116379310344827, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 23, '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': '4764981', 'n_tokens_mistral': 857, 'n_tokens_neox': 785, 'n_words': 185}