import { Component } from 'react'; import { bumpStat } from '../rest-client/bump-stat'; // from $wpnc__title-bar-height in boot/sizes.scss const TITLE_OFFSET = 38; export class EmptyMessage extends Component { componentDidMount() { if ( this.props.showing ) { bumpStat( 'notes-empty-message', this.props.name + '_shown' ); } } componentDidUpdate() { if ( this.props.showing ) { bumpStat( 'notes-empty-message', this.props.name + '_shown' ); } } handleClick = () => bumpStat( 'notes-empty-message', this.props.name + '_clicked' ); render() { const { emptyMessage, link, linkMessage } = this.props; return (
{ link && linkMessage && (

{ emptyMessage }

{ linkMessage }

) } { ! link && linkMessage && (

{ emptyMessage }

{ linkMessage }

) } { ! link && ! linkMessage && (

{ emptyMessage }

) }
); } } export default EmptyMessage;