{"size": 1456, "ext": "js", "max_stars_repo_path": "expose/client/src/component/layouts/shared-components/PublicationHeader.js", "max_stars_repo_name": "alchemy-fr/phraseanet-services", "max_stars_repo_stars_event_min_datetime": "2020-01-12T19:58:42.000Z", "max_stars_repo_stars_event_max_datetime": "2020-09-08T11:35:33.000Z", "max_issues_repo_path": "expose/client/src/component/layouts/shared-components/PublicationHeader.js", "max_issues_repo_name": "alchemy-fr/phraseanet-services", "max_issues_repo_issues_event_min_datetime": "2020-01-07T10:32:36.000Z", "max_issues_repo_issues_event_max_datetime": "2021-12-10T11:04:44.000Z", "max_forks_repo_path": "expose/client/src/component/layouts/shared-components/PublicationHeader.js", "max_forks_repo_name": "alchemy-fr/phrasea", "max_forks_repo_forks_event_min_datetime": "2020-04-20T09:46:21.000Z", "max_forks_repo_forks_event_max_datetime": "2020-04-20T09:46:21.000Z"}
{"max_stars_count": 5, "max_issues_count": 29, "max_forks_count": 1, "avg_line_length": 33.0909090909, "max_line_length": 100, "alphanum_fraction": 0.5054945055}
import React, {PureComponent} from 'react';
import {dataShape} from "../../props/dataShape";
import config from "../../../lib/config";
import Description from "./Description";
import ZippyDownloadButton from "./ZippyDownloadButton";
import moment from "moment";

export default class PublicationHeader extends PureComponent {
    static propTypes = {
        data: dataShape,
    };

    render() {
        const data = this.props.data;
        const {title, assets, description, layoutOptions, date} = data;

        return <div className={'pub-header'}>
            <div style={{
                position: 'relative',
            }}>
                {layoutOptions.logoUrl && <div className={'logo'}>
                    <img src={layoutOptions.logoUrl} alt={''}/>
                </div>}
                <h1>{title}</h1>
                {date ? <time>{moment(date).format('LLLL')}</time> : ''}
                {assets.length > 0 && config.get('zippyEnabled') && <div style={{
                    position: 'absolute',
                    top: 0,
                    right: 0,
                }}>
                </div>}
            </div>
            {description && <Description
                descriptionHtml={description}
            />}
            {config.get('zippyEnabled') && assets.length > 0 && <div className={'download-archive'}>
                <ZippyDownloadButton id={data.id} data={data} />
            </div>}
        </div>
    }

}

