@@ -496,12 +528,39 @@ export function CreateSupplyPage() {
)}
-
- {mockProducts.map((product) => {
+ {productsLoading ? (
+
+
+
+
Загружаем товары...
+
+
+ ) : wholesalerProducts.length === 0 ? (
+
+
+
+
У этого оптовика нет товаров
+
Выберите другого оптовика
+
+
+ ) : (
+
+ {wholesalerProducts.map((product: {
+ id: string;
+ name: string;
+ article: string;
+ description?: string;
+ price: number;
+ quantity: number;
+ category?: { name: string };
+ brand?: string;
+ color?: string;
+ size?: string;
+ mainImage?: string;
+ images?: string[]
+ }) => {
const selectedQuantity = getSelectedQuantity(product.id)
- const discountedPrice = product.discount
- ? product.price * (1 - product.discount / 100)
- : product.price
+ const discountedPrice = product.price // Убираем discount так как его нет в схеме
return (
@@ -519,14 +578,7 @@ export function CreateSupplyPage() {
- {/* Discount badge */}
- {product.discount && (
-
-
- -{product.discount}%
-
-
- )}
+ {/* Убираем discount badge так как поля нет в схеме */}
{/* Overlay с кнопками */}
@@ -550,16 +602,7 @@ export function CreateSupplyPage() {
{product.brand}
)}
- {product.isNew && (
-
- NEW
-
- )}
- {product.isBestseller && (
-
- ХИТ
-
- )}
+ {/* Убираем isNew и isBestseller так как этих полей нет в схеме */}
{product.name}
@@ -578,11 +621,7 @@ export function CreateSupplyPage() {
{formatCurrency(discountedPrice)}
- {product.discount && (
-
- {formatCurrency(product.price)}
-
- )}
+ {/* Убираем отображение оригинальной цены так как discount нет */}