import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Container, Notification } from '@redux-devtools/ui';
import { clearNotification } from '../actions';
import Header from '../components/Header';
import Actions from '../containers/Actions';
import Settings from '../components/Settings';
class App extends Component {
  render() {
    const {
      section,
      theme,
      notification
    } = this.props;
    let body;
    switch (section) {
      case 'Settings':
        body = /*#__PURE__*/React.createElement(Settings, null);
        break;
      default:
        body = /*#__PURE__*/React.createElement(Actions, null);
    }
    return /*#__PURE__*/React.createElement(Container, {
      themeData: theme
    }, /*#__PURE__*/React.createElement(Header, {
      section: section
    }), body, notification && /*#__PURE__*/React.createElement(Notification, {
      type: notification.type,
      onClose: this.props.clearNotification
    }, notification.message));
  }
}
const mapStateToProps = state => ({
  section: state.section,
  theme: state.theme,
  notification: state.notification
});
const actionCreators = {
  clearNotification
};
export default connect(mapStateToProps, actionCreators)(App);