-
+
{product.brand && (
{product.brand}
)}
-
- {product.category}
-
+ {product.isNew && (
+
+ NEW
+
+ )}
+ {product.isBestseller && (
+
+ ХИТ
+
+ )}
-
+
{product.name}
-
- Артикул: {product.article}
-
- {/* Описание */}
-
- {product.description}
-
-
- {/* Характеристики */}
-
- {product.color && (
-
-
- Цвет:
{product.color}
-
- )}
- {product.size && (
-
- Размер: {product.size}
-
- )}
- {product.weight && (
-
- Вес: {product.weight} г
-
- )}
+ {/* Основная характеристика */}
+
+ {product.color && {product.color}}
+ {product.size && {product.size}}
{/* Цена */}
-
-
-
-
- {formatCurrency(discountedPrice)}
-
- {product.discount && (
-
- {formatCurrency(product.price)}
-
- )}
+
+
+
+ {formatCurrency(discountedPrice)}
-
за штуку
+ {product.discount && (
+
+ {formatCurrency(product.price)}
+
+ )}
{/* Управление количеством */}
-
-
-
-
{
- const value = Math.max(0, Math.min(product.quantity, parseInt(e.target.value) || 0))
- updateProductQuantity(product.id, value)
- }}
- className="h-9 w-16 text-center bg-white/10 border-white/20 text-white text-sm"
- min={0}
- max={product.quantity}
- />
-
-
+
+
+
{
+ const value = e.target.value.replace(/[^0-9]/g, '')
+ const numValue = Math.max(0, Math.min(product.quantity, parseInt(value) || 0))
+ updateProductQuantity(product.id, numValue)
+ }}
+ onFocus={(e) => e.target.select()}
+ className="h-8 w-12 text-center bg-white/10 border border-white/20 text-white text-sm rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
+ />
+
{selectedQuantity > 0 && (
-
+
)}
{/* Сумма для выбранного товара */}
{selectedQuantity > 0 && (
-
-
- Сумма: {formatCurrency(discountedPrice * selectedQuantity)}
+
+
+ {formatCurrency(discountedPrice * selectedQuantity)}
{product.discount && (
-
- (экономия {formatCurrency((product.price - discountedPrice) * selectedQuantity)})
-
+
+ экономия {formatCurrency((product.price - discountedPrice) * selectedQuantity)}
+
)}