паспорт товара
This commit is contained in:
1 parent
e517c58d57
commit
5d9191ac24
5 files changed
+206
-1
No files matched your search
@@ -1,14 +1,20 @@
|
||||
import React from "react";
|
||||
import type { Product } from "../../types/product";
|
||||
import styles from "./Catalog.module.css";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
interface Props {
|
||||
product: Product;
|
||||
}
|
||||
|
||||
const ProductCard: React.FC<Props> = ({ product }) => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<div className={styles.card}>
|
||||
<div
|
||||
className={styles.card}
|
||||
onClick={() => navigate(`/product/${product.id}`)}
|
||||
>
|
||||
<img src={product.image} alt={product.name} />
|
||||
<p className={styles.name}>{product.name}</p>
|
||||
<button className={styles.plus}>+</button>
|
||||
|
||||
Reference in new issue
Block a user