import { connect } from "react-redux" ; import { updateCategoryColorAction , updateCategoryDescriptionAction } from "@piximi/store" ; import { Classifier } from "@piximi/types" ; import { Dispatch } from "redux" ; import { EditCategoryDialog } from "./EditCategoryDialog" ; type State = { classifier : Classifier ; } ; const mapStateToProps = ( state ) => { return { categories : state . classifier . categories } ; } ; const mapDispatchToProps = ( dispatch ) => { return { updateColor : ( identifier , color ) => { const payload = { identifier : identifier , color : color } ; const action = updateCategoryColorAction ( payload ) ; dispatch ( action ) ; } , updateDescription : ( identifier , description ) => { const payload = { identifier : identifier , description : description } ; const action = updateCategoryDescriptionAction ( payload ) ; dispatch ( action ) ; } } ; } ; export const ConnectedEditCategoryDialog = connect ( mapStateToProps , mapDispatchToProps ) ( EditCategoryDialog ) ;