2018-07-09 15:46:31 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import classnames from 'classnames';
|
|
|
|
import { Component } from '@wordpress/element';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import './style.scss';
|
2018-09-21 15:19:05 +00:00
|
|
|
import { EllipsisMenu, H } from '@woocommerce/components';
|
2018-07-09 15:46:31 +00:00
|
|
|
|
|
|
|
class ActivityHeader extends Component {
|
|
|
|
render() {
|
|
|
|
const { title, className, menu } = this.props;
|
2020-02-14 02:23:21 +00:00
|
|
|
const cardClassName = classnames(
|
|
|
|
'woocommerce-layout__activity-panel-header',
|
|
|
|
className
|
|
|
|
);
|
2018-07-09 15:46:31 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={ cardClassName }>
|
2020-02-14 02:23:21 +00:00
|
|
|
<H className="woocommerce-layout__activity-panel-header-title">
|
|
|
|
{ title }
|
|
|
|
</H>
|
|
|
|
{ menu && (
|
|
|
|
<div className="woocommerce-layout__activity-panel-header-menu">
|
|
|
|
{ menu }
|
|
|
|
</div>
|
|
|
|
) }
|
2018-07-09 15:46:31 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ActivityHeader.propTypes = {
|
|
|
|
className: PropTypes.string,
|
|
|
|
title: PropTypes.string.isRequired,
|
|
|
|
menu: PropTypes.shape( {
|
|
|
|
type: PropTypes.oneOf( [ EllipsisMenu ] ),
|
|
|
|
} ),
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ActivityHeader;
|