import React from 'react';
import PropTypes from 'prop-types';

import IDUtil from '../../util/IDUtil'; // for generating unique CSS classnames for this component

import { ResourceViewerContext } from './ResourceViewerContext';

/*
	This component show the static metadata and content annotations
*/

export default class ColumnHeader extends React.Component {
    static contextType = ResourceViewerContext;

    constructor(props) {
        super(props);
    }

    render() {
        const closeButton = this.props.onClose ? (
            <div className="close-button" onClick={this.props.onClose} />
        ) : null;

        return (
            <div className={IDUtil.cssClassName('column-header')}>
                {closeButton}
                {this.props.children}
            </div>
        );
    }
}

ColumnHeader.propTypes = {
    onClose: PropTypes.func
};
