import React from 'react'; import './DependencyList.css'; import {connect} from 'react-redux'; import * as Constants from '../../constants'; import Dependency from './Dependency/Dependency'; import Box from '../UI/Box/Box'; import {downloadItem} from '../../redux/actions/download_actions'; import {extractFileNameFromURL} from '../../utils'; const mapStateToProps = state => { return { MissingDependencies: state.install.MissingDependencies, }; }; const mapDispatchToProps = (dispatch) => { return { downloadItem: (name, type, url) => dispatch(downloadItem(name, type, url)) }; }; export default connect(mapStateToProps, mapDispatchToProps)(props => { const items = props.MissingDependencies.map((k, i)=> { return ( props.downloadItem(extractFileNameFromURL(k.download), Constants.INSTALL_TYPES.Dependency, k.download)}/> ); }); return (

Missing Dependencies

{items}
); });