content: import React from 'react'
  import PropTypes from 'prop-types'
  import QueryRendererWithUser from 'js/components/General/QueryRendererWithUser'
  import graphql from 'babel-plugin-relay/macro'
  
  import SettingsChildWrapper from 'js/components/Settings/SettingsChildWrapperComponent'
  import WidgetsSettings from 'js/components/Settings/Widgets/WidgetsSettingsContainer'
  import ErrorMessage from 'js/components/General/ErrorMessage'
  import logger from 'js/utils/logger'
  
  class WidgetsSettingsView extends React.Component {
    render() {
      const { authUser } = this.props
      return (
        <div
          style={{
            height: '100%',
            width: '100%',
          }}
        >
          <QueryRendererWithUser
            query={graphql`
              query WidgetsSettingsViewQuery($userId: String!) {
                app {
                  ...WidgetsSettingsContainer_app
                }
                user(userId: $userId) {
                  ...WidgetsSettingsContainer_user
                }
              }
            `}
            variables={{
              userId: authUser.id,
            }}
            render={({ error, props }) => {
              if (error) {
                logger.error(error)
                const errMsg = 'We had a problem loading the widget settings :('
  
                // Error will not autohide.
                return <ErrorMessage message={errMsg} />
              }
              const showError = this.props.showError
              const dataLoaded = !!props
              return (
                <SettingsChildWrapper>
                  {dataLoaded ? (
                    <WidgetsSettings
                      app={props.app}
                      user={props.user}
                      showError={showError}
                    />
                  ) : null}
                </SettingsChildWrapper>
              )
            }}
          />
        </div>
      )
    }
  }
  
  WidgetsSettingsView.propTypes = {
    authUser: PropTypes.shape({
      id: PropTypes.string.isRequired,
    }).isRequired,
    showError: PropTypes.func.isRequired,
  }
  
  WidgetsSettingsView.defaultProps = {}
  
  export default WidgetsSettingsView
  