<commit_before>import React from 'react'
import InfoPanelCard from './InfoPanelCard'

class FileInfoCard extends React.Component {
    constructor(props) {
        super(props)

        const meta = props.node.getMetadata();

        let size = meta.get('bytesize');
        let hSize = PathUtils.roundFileSize(parseInt(size));
        let time = meta.get('ajxp_modiftime');
        var date = new Date();
        date.setTime(parseInt(meta.get('ajxp_modiftime')) * 1000);

        let formattedDate = PathUtils.formatModifDate(date);

        let data = [
            {key:'size',label:'File Size',value:hSize},
            {key:'date',label:'Modified on',value:formattedDate}
        ];

        let w = meta.get('image_width');
        let h = meta.get('image_height');
        if(w && h){
            data = [
                ...data,
                {key:'image', label:'Image Dimension', value:w + 'px X ' + h + 'px'}
            ]
        }

        this.state = {
            data: data
        }
    }

    render() {
        return (
            <InfoPanelCard {...this.props} title="File Information" standardData={this.state.data} contentStyle={{paddingBottom: 10}} icon="information-outline" iconColor="#2196f3"/>
        );
    }
}

export {FileInfoCard as default}<commit_msg>Fix FileInfoCard rendering<commit_after>import React from 'react'
import Pydio from 'pydio'
import InfoPanelCard from './InfoPanelCard'
const {PydioContextConsumer} = Pydio.requireLib('boot')

class FileInfoCard extends React.Component {

    render() {

        const {node, getMessage} = this.props;
        const meta = node.getMetadata();

        let size = meta.get('bytesize');
        let hSize = PathUtils.roundFileSize(parseInt(size));
        let time = meta.get('ajxp_modiftime');
        var date = new Date();
        date.setTime(parseInt(meta.get('ajxp_modiftime')) * 1000);
        let formattedDate = PathUtils.formatModifDate(date);

        let data = [
            {key:'size',label:getMessage('2'),value:hSize},
            {key:'date',label:getMessage('4'),value:formattedDate}
        ];

        let w = meta.get('image_width');
        let h = meta.get('image_height');
        if(w && h){
            data = [
                ...data,
                {key:'image', label:getMessage('135'), value:w + 'px X ' + h + 'px'}
            ]
        }

        return (
            <InfoPanelCard
                {...this.props}
                title={getMessage('341')}
                standardData={data}
                contentStyle={{paddingBottom: 10}}
                icon="information-outline"
                iconColor="#2196f3"
            />
        );
    }
}

FileInfoCard = PydioContextConsumer(FileInfoCard);
export {FileInfoCard as default}
{'fraction_non_alphanumeric': 0.13815551537070525, 'fraction_numerical': 0.0108499095840868, 'mean_word_length': 2.1183765501691094, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6989571', 'n_tokens_mistral': 827, 'n_tokens_neox': 790, 'n_words': 159}