import React from 'react';
import { connect } from 'react-redux';
import cronstrue from 'cronstrue';

const NotificationSummary = (props) => {

	console.log("NotificationSummary component props: ", props);
	var summary = ((props.type=='NOW')?"Notification would be sent immediately after all the three steps .":((props.summary)?(cronstrue.toString(props.summary)):'No Summary'))
	summary = (summary && summary.length)?summary.replace('null',''):'';
	return (
				<div className="NotificationSummary">
					<div className="heading">Summary</div>
					<div className="summary">{summary}</div>
				</div>
		  )
};

export default NotificationSummary;