import { connect } from "react-redux" ; import { toggleCategoryVisibilityAction , updateCategoryVisibilityAction , updateImageCategoryAction } from "@piximi/store" ; import { Classifier } from "@piximi/types" ; import { Dispatch } from "redux" ; import { CategoryListItem } from "./CategoryListItem" ; type State = { classifier : Classifier ; } ; const mapStateToProps = ( state ) => { return { categories : state . classifier . categories } ; } ; const mapDispatchToProps = ( dispatch ) => { return { toggleVisibility : ( identifier ) => { const payload = { identifier : identifier } ; const action = toggleCategoryVisibilityAction ( payload ) ; dispatch ( action ) ; } } ; } ; export const ConnectedCategoryListItem = connect ( mapStateToProps , mapDispatchToProps ) ( CategoryListItem ) ;