<commit_before>import React from 'react'
import EditableLabel from 'seedsource/components/EditableLabel'
import ReactTooltip from "react-tooltip"

export default ({ trait, traitConfig, onRemove, onTransferChange }) => {
    let { name, value } = trait
    let { customTransfer, label, description = null } = traitConfig
    let transfer = trait.transfer === null ? traitConfig.transfer : trait.transfer

    return <tr data-tip data-for={name + "_Tooltip"}>
        <td>
            <a
                type="button"
                className="delete"
                onClick={e => {
                    e.stopPropagation()
                    onRemove()
                }}
            ></a>
        </td>
        <td className="trait-label">
            <strong>{label}</strong>
        </td>
        <td>
            {value !== null ? value.toFixed(2) : '--'}
        </td>
        <td>
            {
                customTransfer ?
                <EditableLabel value={transfer} onChange={value => onTransferChange(value)}/> : transfer
            }

            <ReactTooltip id={name + "_Tooltip"} className="variable-tooltip" place="right" effect="solid">
                <h5 className="title is-5 margin-bottom-5">{label}</h5>
                {description !== null ? <div className="is-size-7 has-text-grey-lighter">{description}</div> : null}
                <div>
                    <span className="tooltip-label">Value at point:</span>
                    <strong>{value !== null ? value.toFixed(2) : '--'}</strong>
                </div>
                <div>
                    <span className="tooltip-label">Transfer limit (+/-):</span>
                    <strong>{transfer}</strong>
                </div>
            </ReactTooltip>
        </td>
    </tr>
}<commit_msg>Add trait units<commit_after>import React from 'react'
import EditableLabel from 'seedsource/components/EditableLabel'
import ReactTooltip from "react-tooltip"

export default ({ trait, traitConfig, onRemove, onTransferChange }) => {
    let { name, value } = trait
    let { customTransfer, label, units = null, description = null } = traitConfig
    let transfer = trait.transfer === null ? traitConfig.transfer : trait.transfer

    return <tr data-tip data-for={name + "_Tooltip"}>
        <td>
            <a
                type="button"
                className="delete"
                onClick={e => {
                    e.stopPropagation()
                    onRemove()
                }}
            ></a>
        </td>
        <td className="trait-label">
            <strong>{label}</strong>
        </td>
        <td>
            {value !== null ? value.toFixed(2) : '--'} {units}
        </td>
        <td>
            {
                customTransfer ?
                <EditableLabel value={transfer} onChange={value => onTransferChange(value)}/> : transfer
            } {units}

            <ReactTooltip id={name + "_Tooltip"} className="variable-tooltip" place="right" effect="solid">
                <h5 className="title is-5 margin-bottom-5">{label}</h5>
                {description !== null ? <div className="is-size-7 has-text-grey-lighter">{description}</div> : null}
                <div>
                    <span className="tooltip-label">Value at point:</span>
                    <strong>{value !== null ? value.toFixed(2) : '--'} {units}</strong>
                </div>
                <div>
                    <span className="tooltip-label">Transfer limit (+/-):</span>
                    <strong>{transfer} {units}</strong>
                </div>
            </ReactTooltip>
        </td>
    </tr>
}
{'fraction_non_alphanumeric': 0.1443526170798898, 'fraction_numerical': 0.003856749311294766, 'mean_word_length': 1.6659324522760646, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 75, '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': '520337', 'n_tokens_mistral': 970, 'n_tokens_neox': 946, 'n_words': 207}