import React from 'react'; interface IProps { availableActions: Array; children: any; } interface IState { actionsDropdownOpen: boolean; } export class EditorHighlightsHeader extends React.Component { constructor(props) { super(props); this.state = { actionsDropdownOpen: false, }; } toggleActionsDropdown() { this.setState({ actionsDropdownOpen: !this.state.actionsDropdownOpen, }); } render() { const {availableActions} = this.props; const actionsDropdownStyles: any = this.state.actionsDropdownOpen !== true ? {} : { display: 'block', position: 'absolute', width: 'auto', padding: '1rem 0', marginBottom: 12, // so the last item doesn't look like it's shaddow is cut off }; return (
{this.props.children}
{ availableActions.length < 1 ? null : (
    { availableActions.map((action, i) => (
  • )) }
) }
); } }