import React from 'react' import { connect } from 'react-redux' function Gate(props) { const { app, tag, View } = props const data = app[tag] if (!data) return null if (data === 'loading') { return
{tag}{': Loading'}
} if (data.err) { return
{tag}{' Error: '}{data.err}
} return } const mapStateToProps = state => ({ app: state.metadata }) export default connect(mapStateToProps)(Gate)