import { connect } from "react-redux" ; import { DeleteImageDialog } from "./DeleteImageDialog" ; import { deleteImageAction } from "@piximi/store" ; import { Dispatch } from "redux" ; import { Classifier } from "@piximi/types" ; type State = { classifier : Classifier ; } ; const mapStateToProps = ( state ) => { return { images : state . classifier . images } ; } ; const mapDispatchToProps = ( dispatch ) => { return { deleteImages : ( identifiers ) => { for ( let identifier of identifiers ) { const payload = { identifier : identifier } ; const action = deleteImageAction ( payload ) ; dispatch ( action ) ; } } } ; } ; export const ConnectedDeleteImageDialog = connect ( mapStateToProps , mapDispatchToProps ) ( DeleteImageDialog ) ;