import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Container, Form } from '@redux-devtools/ui';
import { changeStateTreeSettings } from '../../actions';
export class StateTree extends Component {
  render() {
    const stateTree = this.props.theme;
    const formData = {
      sortAlphabetically: stateTree.sortAlphabetically,
      disableCollection: stateTree.disableCollection
    };
    return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Form, {
      schema: {
        type: 'object',
        properties: {
          sortAlphabetically: {
            title: 'Sort Alphabetically',
            type: 'boolean'
          },
          disableCollection: {
            title: 'Disable collapsing of nodes',
            type: 'boolean'
          }
        }
      },
      formData: formData,
      noSubmit: true,
      onChange: this.props.changeStateTreeSettings
    }));
  }
}
const mapStateToProps = state => ({
  theme: state.stateTreeSettings
});
const actionCreators = {
  changeStateTreeSettings
};
export default connect(mapStateToProps, actionCreators)(StateTree);