<commit_before>import React, { Component } from "react";
import TextOverflowWrapperNew from "dnn-text-overflow-wrapper-new";
import { PropTypes } from "prop-types";
import utils from "utils";

import "./styles.less";

import PersonaBarPageIcon from "./_PersonaBarPageIcon";
import PersonaBarExpandCollapseIcon from "./_PersonaBarExpandCollapseIcon";
import PersonaBarDraftPencilIcon from "./_PersonaBarDraftPencilIcon";

export class PersonaBarPageTreeview extends Component {

    

    constructor() {
        super();
        this.state = {};
        this.ua = navigator.userAgent.toLowerCase(); 
    }

    trimName(item) {
        let maxLength = 18;
        let { name, tabpath } = item;
        let newLength = tabpath.split(/\//).length * 2 + 3;
        newLength--;
        let depth = (newLength < maxLength) ? newLength : 1;
        return (item.name.length > maxLength - depth) ? `${item.name.slice(0, maxLength - depth)}...` : item.name;

    }

    render_tree(item, childListItems) {
        const {
            draggedItem,
            droppedItem,
            dragOverItem,
            getChildListItems,
            onSelection,
            onNoPermissionSelection,
            onDrop,
            onDrag,
            onDragStart,
            onDragEnter,
            onDragOver,
            onDragLeave,
            onDragEnd,
            onMovePage,
            setEmptyPageMessage,
            Localization
        } = this.props;

        return (
            <PersonaBarPageTreeview
                draggedItem={draggedItem}<commit_msg>Code cleanup<commit_after>import React, { Component } from "react";
import TextOverflowWrapperNew from "dnn-text-overflow-wrapper-new";
import { PropTypes } from "prop-types";
import utils from "utils";

import "./styles.less";

import PersonaBarPageIcon from "./_PersonaBarPageIcon";
import PersonaBarExpandCollapseIcon from "./_PersonaBarExpandCollapseIcon";
import PersonaBarDraftPencilIcon from "./_PersonaBarDraftPencilIcon";

export class PersonaBarPageTreeview extends Component {
    
    constructor() {
        super();
        this.state = {};
    }

    trimName(item) {
        let maxLength = 18;
        let { name, tabpath } = item;
        let newLength = tabpath.split(/\//).length * 2 + 2;
        let depth = (newLength < maxLength) ? newLength : 1;
        return (item.name.length > maxLength - depth) ? `${item.name.slice(0, maxLength - depth)}...` : item.name;
    }

    render_tree(item, childListItems) {
        const {
            draggedItem,
            droppedItem,
            dragOverItem,
            getChildListItems,
            onSelection,
            onNoPermissionSelection,
            onDrop,
            onDrag,
            onDragStart,
            onDragEnter,
            onDragOver,
            onDragLeave,
            onDragEnd,
            onMovePage,
            setEmptyPageMessage,
            Localization
        } = this.props;

        return (
            <PersonaBarPageTreeview
                draggedItem={draggedItem}
{'fraction_non_alphanumeric': 0.09674234945705824, 'fraction_numerical': 0.003948667324777887, 'mean_word_length': 2.049147442326981, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '2685164', 'n_tokens_mistral': 849, 'n_tokens_neox': 835, 'n_words': 181}