import { Stack, Typography, Divider, LinearProgress } from "@mui/material"; import { Box } from "@mui/system"; import { connect } from "react-redux"; import { useSearchParams } from "react-router-dom"; import { GoodList } from "../common/GoodList"; import { SubCategories } from "./SubCategories"; import { SortOptions } from "../common/SortOptions"; const GoodsPage = ({ category = {}, goods = [], promiseStatus = null }) => { const { name = "", subcategories = [] } = category || {}; const [searchParams, setSearchParams] = useSearchParams(); return ( {name} {name && } { searchParams.set("orderBy", option.value); setSearchParams(searchParams); }} /> {!!subcategories.length ? ( Категорії ) : null} {!!goods.length ? ( Товари ) : null} {promiseStatus === "PENDING" && } ); }; const CGoodsPage = connect((state) => ({ category: state?.promise?.catById?.payload || {}, goods: state?.feed?.payload || [], promiseStatus: state.promise?.feedCategoryGoods?.status || state.promise?.feedGoodsFind?.status || null, }))(GoodsPage); export { GoodsPage, CGoodsPage };