import DownloadBadge from '../components/DownloadBadge' ; import * as actions from '../actions/' ; import { StoreState } from '../types' ; import { connect , Dispatch } from 'react-redux' ; import * as types from '../common-interfaces' ; interface Props { jobs : types . DownloadJob [ ] ; } export function mapStateToProps ( { logEvents } ) { let allJobs = logEvents . runningJobs . concat ( logEvents . finishedJobs , logEvents . errorJobs ) . sort ( ( a , b ) => b . startTime - a . startTime ) ; return { jobs : allJobs , } ; } export function mapDispatchToProps ( dispatch ) { return { } ; } export default connect ( mapStateToProps , mapDispatchToProps ) ( DownloadBadge ) ;