/** @format */
/**
* External dependencies
*/
import classnames from 'classnames';
import { Component } from '@wordpress/element';
import { Dashicon, IconButton } from '@wordpress/components';
import PropTypes from 'prop-types';
/**
* Internal dependencies
*/
import Count from 'components/count';
class AgendaHeader extends Component {
constructor( props ) {
super( ...arguments );
this.state = {
opened: props.initialOpen === undefined ? false : props.initialOpen,
};
this.toggle = this.toggle.bind( this );
}
toggle( event ) {
event.preventDefault();
event.stopPropagation();
if ( this.props.opened === undefined ) {
this.setState( state => ( {
opened: ! state.opened,
} ) );
}
if ( this.props.onToggle ) {
this.props.onToggle();
}
}
renderLink() {
const { title, className, count, href } = this.props;
const classes = classnames( 'woo-dash__agenda-group-wrapper', className );
return (
{ count &&