дописал логику подгрузки характеристик продукта

This commit is contained in:
Joe_Peach committed 2026-02-11 17:43:21 +03:00
1 parent 5d9191ac24
commit a18a706366
1 file changed
+6 -4
+6 -4
View File
@@ -3,8 +3,7 @@ import { useParams, useNavigate } from "react-router-dom";
import { useAppDispatch, useAppSelector } from "../../app/hooks";
import { fetchProductById } from "../../features/catalog/productsSlice";
import styles from "./ProductPage.module.css";
//import type { Product } from "../../types/product";
import type { CategoryAtributes } from "../../types/categories";
import type { CategoryAtributes, CategoryAtrVals } from "../../types/categories";
const ItemPage = () => {
const { id } = useParams();
@@ -12,7 +11,6 @@ const ItemPage = () => {
const navigate = useNavigate();
const { items, loading } = useAppSelector((state) => state.products);
const { items: cats, selectedCategoryId } = useAppSelector(s => s.categories);
//const filters = useAppSelector(s => s.products.filtersApplied);
const [activeTab, setActiveTab] = useState<"desc" | "chars">("desc");
@@ -83,7 +81,11 @@ const ItemPage = () => {
{category.atributes?.map((attr: CategoryAtributes) => (
<div key={attr.id} className={styles.attrRow}>
<span>{attr.name}</span>
<span>{}</span>
{attr.vals?.map((val: CategoryAtrVals) => (
<div key={val.id}>
<span>{val.val}</span>
</div>
))}
</div>
))}
</div>