import * as React from "react"; import { Everything } from "../../interfaces"; import { connect } from "react-redux"; import { history } from "../../history"; import { unselectPlant } from "../map/actions"; import { selectAllSavedGardens, selectAllPlantTemplates, selectAllPlantPointers, } from "../../resources/selectors"; import { SavedGardenList } from "./garden_list"; import { SavedGardensProps, SavedGardensState } from "./interfaces"; import { closeSavedGarden } from "./actions"; import { DesignerPanel, DesignerPanelContent, DesignerPanelTop, } from "../designer_panel"; import { DesignerNavTabs, Panel } from "../panel_header"; import { t } from "../../i18next_wrapper"; import { EmptyStateWrapper, EmptyStateGraphic, } from "../../ui/empty_state_wrapper"; import { Content } from "../../constants"; import { SearchField } from "../../ui/search_field"; export const mapStateToProps = (props: Everything): SavedGardensProps => ({ savedGardens: selectAllSavedGardens(props.resources.index), plantTemplates: selectAllPlantTemplates(props.resources.index), dispatch: props.dispatch, plantPointerCount: selectAllPlantPointers(props.resources.index).length, openedSavedGarden: props.resources.consumers.farm_designer.openedSavedGarden, }); export class RawSavedGardens extends React.Component { state: SavedGardensState = { searchTerm: "" }; componentDidMount() { unselectPlant(this.props.dispatch)(); } render() { return this.setState({ searchTerm })} /> 0} title={t("No saved gardens yet.")} text={t(Content.NO_GARDENS)} colorScheme="gardens" graphic={EmptyStateGraphic.plants}> ; } } /** Sticky an indicator and actions menu when a SavedGarden is open. */ export const SavedGardenHUD = (props: { dispatch: Function }) =>
; export const SavedGardens = connect(mapStateToProps)(RawSavedGardens);