chore: update
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
||||
Video as VideoIcon,
|
||||
Play,
|
||||
} from "lucide-react";
|
||||
import type { Product } from "../api/api_admin_types"; // ✅ CORRIGÉ
|
||||
import type { Product, ProductPrice } from "../api/api_types";
|
||||
import "./ProductModal.css";
|
||||
|
||||
interface ProductDetailsModalProps {
|
||||
@@ -169,7 +169,7 @@ const ProductDetailsModal: React.FC<ProductDetailsModalProps> = ({
|
||||
{/* Miniatures */}
|
||||
{product.media && product.media.length > 1 && (
|
||||
<div className="media-thumbnails">
|
||||
{product.media.map((media, index) => (
|
||||
{product.media.map((media: { url: string; type: string }, index: number) => (
|
||||
<button
|
||||
key={index}
|
||||
className={`thumbnail ${index === currentMediaIndex ? "active" : ""}`}
|
||||
@@ -247,7 +247,7 @@ const ProductDetailsModal: React.FC<ProductDetailsModalProps> = ({
|
||||
</h3>
|
||||
<div className="prices-table">
|
||||
{product.prices && product.prices.length > 0 ? (
|
||||
product.prices.map((price, index) => (
|
||||
product.prices.map((price: ProductPrice, index: number) => (
|
||||
<div
|
||||
key={index}
|
||||
className="price-row-display"
|
||||
@@ -286,12 +286,12 @@ const ProductDetailsModal: React.FC<ProductDetailsModalProps> = ({
|
||||
<span>
|
||||
{
|
||||
product.media.filter(
|
||||
(m) => m.type === "image",
|
||||
(m: { url: string; type: string }) => m.type === "image",
|
||||
).length
|
||||
}{" "}
|
||||
Image
|
||||
{product.media.filter(
|
||||
(m) => m.type === "image",
|
||||
(m: { url: string; type: string }) => m.type === "image",
|
||||
).length > 1
|
||||
? "s"
|
||||
: ""}
|
||||
@@ -302,12 +302,12 @@ const ProductDetailsModal: React.FC<ProductDetailsModalProps> = ({
|
||||
<span>
|
||||
{
|
||||
product.media.filter(
|
||||
(m) => m.type === "video",
|
||||
(m: { url: string; type: string }) => m.type === "video",
|
||||
).length
|
||||
}{" "}
|
||||
Vidéo
|
||||
{product.media.filter(
|
||||
(m) => m.type === "video",
|
||||
(m: { url: string; type: string }) => m.type === "video",
|
||||
).length > 1
|
||||
? "s"
|
||||
: ""}
|
||||
|
||||
Reference in New Issue
Block a user