chore: update
This commit is contained in:
@@ -14,6 +14,7 @@ interface ProductCardProps {
|
||||
prices?: Array<{ quantity: number; price: number }>;
|
||||
hasVideo?: boolean;
|
||||
videoUrl?: string; // ✨ Nouveau prop pour l'URL de la vidéo
|
||||
categoryColor?: string;
|
||||
}
|
||||
|
||||
function ProductCard({
|
||||
@@ -27,6 +28,7 @@ function ProductCard({
|
||||
prices,
|
||||
hasVideo = false,
|
||||
videoUrl,
|
||||
categoryColor,
|
||||
}: ProductCardProps) {
|
||||
const navigate = useNavigate();
|
||||
const { addToCart } = useCart();
|
||||
@@ -162,6 +164,11 @@ function ProductCard({
|
||||
className={`quick-add-btn ${isOutOfStock ? "disabled" : ""}`}
|
||||
onClick={handleQuickAddClick}
|
||||
disabled={isOutOfStock}
|
||||
style={
|
||||
categoryColor && !isOutOfStock
|
||||
? { background: categoryColor }
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{isOutOfStock
|
||||
? "Rupture de stock"
|
||||
@@ -174,6 +181,11 @@ function ProductCard({
|
||||
value={selectedQuantity ?? ""}
|
||||
onChange={handleQuantitySelect}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
style={
|
||||
categoryColor
|
||||
? { borderColor: categoryColor }
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<option value="">Choisir une quantité</option>
|
||||
{prices.map((priceOption) => (
|
||||
|
||||
Reference in New Issue
Block a user