:D
This commit is contained in:
@@ -87,10 +87,10 @@ export const ProductModal: React.FC<ProductModalProps> = ({
|
||||
const handleAddTier = () => {
|
||||
setProductData((prev) => ({
|
||||
...prev,
|
||||
pricing: [...prev.pricing, { minQuantity: 0, pricePerUnit: 0 }],
|
||||
pricing: [...prev.pricing, { minQuantity: 0, pricePerUnit: 0 }],
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
const handleSave = async () => {
|
||||
if (!productData.category) {
|
||||
toast.error("Please select or add a category");
|
||||
@@ -114,7 +114,7 @@ export const ProductModal: React.FC<ProductModalProps> = ({
|
||||
...prev,
|
||||
pricing: prev.pricing.map((tier, i) =>
|
||||
i === index
|
||||
? { ...tier, [name]: value === "" ? 0 : Number(value) }
|
||||
? { ...tier, [name]: value === "" ? 0 : Number(value) }
|
||||
: tier
|
||||
),
|
||||
}));
|
||||
@@ -122,7 +122,7 @@ export const ProductModal: React.FC<ProductModalProps> = ({
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onClose}>
|
||||
<DialogContent className="max-w-6xl">
|
||||
<DialogContent className="max-w-[95vw] lg:max-w-6xl w-full overflow-y-auto max-h-[90vh] z-[80]">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-base">
|
||||
{editing ? "Edit Product" : "Add Product"}
|
||||
@@ -221,9 +221,9 @@ const CategorySelect: React.FC<CategorySelectProps> = ({
|
||||
|
||||
// Get root categories (those without parentId)
|
||||
const rootCategories = categories.filter(cat => !cat.parentId);
|
||||
|
||||
|
||||
// Get subcategories for a given parent
|
||||
const getSubcategories = (parentId: string) =>
|
||||
const getSubcategories = (parentId: string) =>
|
||||
categories.filter(cat => cat.parentId === parentId);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user