import React from 'react';
import { connect } from 'react-redux';
import * as actions from './actions';
import FormField from './forms/FormField.js';
import EndsOnDateTimeWidget from './EndsOnDateTimeWidget';

class NotificationEndsWidget extends React.Component {
	componentDidMount(){
		this.props.HandleChangeNotificationEnds({label: 'On', value: 'ON', selected:true});
	}
	render() {
	console.log("NotificationEndsWidget component props: ", this.props);
		return (
					<div className="NotificationEndsWidget relative">
						<span style={{
							'margin-left': '24px','font-size': '14px'
						}}>Ends At :</span>
						<EndsOnDateTimeWidget />
					</div>
		)
	}
};

const mapStateToProps = (state) =>{
	console.log("****** NotificationEndsWidget.js state:", state);
	return {
		EndNotificationOptions : state.get('whenReducer').get('EndNotificationOptions').toJS()
	}
}


export default connect(mapStateToProps,actions)(NotificationEndsWidget);