<commit_before>import React, { PureComponent } from 'react'
import { PropTypes } from 'prop-types'

import classNames from 'classnames/bind'

import Wizard from './wizard'
import ConsolePanel from './consolePanel'
import styles from '../styles/core.scss'
import { isValid } from '../lib/utils'

const cx = classNames.bind(styles)

export default class GatherMove extends PureComponent {
	static propTypes = {
		store: PropTypes.object.isRequired,
		match: PropTypes.object.isRequired,
	}

	componentDidMount() {
		const { actions } = this.props.store

		// if (Object.keys(state.gatherTree.chosen).length === 0 || !isValid(state.gatherTree.target)) {
		// 	return
		// }

		// actions.move()
		actions.clearConsole()
	}

	render() {
		const { match, store: { state, actions } } = this.props

		if (Object.keys(state.gatherTree.chosen).length === 0 || !isValid(state.gatherTree.target)) {
			return null
		}

		let consolePanel = null
		if (state.lines.length !== 0) {
			consolePanel = (
				<section className={cx('row', 'bottom-spacer-half')}>
					<div className={cx('col-xs-12')}>
						<ConsolePanel lines={state.lines} styleClass={'console-feedback'} />
					</div>
				</section>
			)
		}

		return (
			<div>
				<Wizard match={match} store={this.props.store} />
				{consolePanel}
				<section className={cx('row', 'bottom-spacer-half')}>
					<div className={cx('col-xs-12')}>
						<button
							className={cx('btn', 'btn-primary')}
							onClick={() => actions.gather(state.gatherTree.target)}
							disabled={state.transferDisabled || state.opInProgress}
						>
							MOVE
						</button>
					</div>
				</section>
			</div>
		)
	}
}<commit_msg>Improve UI for Move step<commit_after>import React, { PureComponent } from 'react'
import { PropTypes } from 'prop-types'

import classNames from 'classnames/bind'

import Wizard from './wizard'
import ConsolePanel from './consolePanel'
import styles from '../styles/core.scss'
import { isValid, humanBytes } from '../lib/utils'

const cx = classNames.bind(styles)

export default class GatherMove extends PureComponent {
	static propTypes = {
		store: PropTypes.object.isRequired,
		match: PropTypes.object.isRequired,
	}

	componentDidMount() {
		const { actions } = this.props.store

		// if (Object.keys(state.gatherTree.chosen).length === 0 || !isValid(state.gatherTree.target)) {
		// 	return
		// }

		// actions.move()
		actions.clearConsole()
	}

	render() {
		const { match, store: { state, actions } } = this.props

		if (Object.keys(state.gatherTree.chosen).length === 0 || !isValid(state.gatherTree.target)) {
			return null
		}

		let consolePanel = null
		if (state.lines.length !== 0) {
			consolePanel = (
				<section className={cx('row', 'bottom-spacer-half')}>
					<div className={cx('col-xs-12')}>
						<ConsolePanel lines={state.lines} styleClass={'console-feedback'} />
					</div>
				</section>
			)
		}

		let summary = null
		let proceed = null
		if (!(state.transferDisabled || state.opInProgress)) {
			let dst = null
			let size = 0

			state.unraid.disks.forEach(disk => {
				if (disk.dst) {
					dst = disk
					size = dst.free - dst.newFree
				}
			})

			if (dst) {
				summary = (
					<section className={cx('row', 'bottom-spacer-half')}>
						<div className={cx('col-xs-12')}>
							<b>{humanBytes(size)}</b> will be transferred to {dst.path}.
						</div>
					</section>
				)
			}

			proceed = (
				<section className={cx('row', 'bottom-spacer-half')}>
					<div className={cx('col-xs-12')}>
						<button
							className={cx('btn', 'btn-primary')}
							onClick={() => actions.gather(state.gatherTree.target)}
							disabled={state.transferDisabled || state.opInProgress}
						>
							PROCEED
						</button>
					</div>
				</section>
			)
		}

		return (
			<div>
				<Wizard match={match} store={this.props.store} />
				{consolePanel}
				{summary}
				{proceed}
			</div>
		)
	}
}
{'fraction_non_alphanumeric': 0.16474506789648988, 'fraction_numerical': 0.004355623879067384, 'mean_word_length': 3.024742268041237, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 40, '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': '1990602', 'n_tokens_mistral': 1572, 'n_tokens_neox': 1290, 'n_words': 263}