This commit is contained in:
g
2025-02-09 02:15:26 +00:00
parent 7ec17cfd73
commit 72ea64df15
2 changed files with 30 additions and 16 deletions

View File

@@ -6,7 +6,10 @@ import { Trash, PlusCircle } from "lucide-react";
interface PricingTiersProps {
pricing: any[];
handleTierChange: (e: React.ChangeEvent<HTMLInputElement>, index: number) => void;
handleTierChange: (
e: React.ChangeEvent<HTMLInputElement>,
index: number
) => void;
handleRemoveTier: (index: number) => void;
handleAddTier: () => void;
}
@@ -26,17 +29,17 @@ export const PricingTiers = ({
<Input
name="minQuantity"
type="number"
min="1"
placeholder="Min Quantity"
value={tier.minQuantity}
value={tier.minQuantity === 0 ? "" : tier.minQuantity} // ✅ Show empty string when 0
onChange={(e) => handleTierChange(e, index)}
className="h-8 text-sm px-2 flex-1"
/>
<Input
name="pricePerUnit"
type="number"
placeholder="Price per unit"
value={tier.pricePerUnit}
value={tier.pricePerUnit === 0 ? "" : tier.pricePerUnit} // ✅ Show empty string when 0
onChange={(e) => handleTierChange(e, index)}
className="h-8 text-sm px-2 flex-1"
/>
@@ -64,4 +67,4 @@ export const PricingTiers = ({
Add Tier
</Button>
</div>
);
);