chore(workspace): eradicate all tsc errors and eslint warnings across frontend, admin, and backend
Deploy Canina / deploy (push) Failing after 29s
Deploy Canina / deploy (push) Failing after 29s
This commit is contained in:
1 parent
4659a7b1de
commit
9f11d8fb2d
98 files changed
+1272
-1009
No files matched your search
@@ -1,8 +1,8 @@
|
||||
"use client";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { motion, AnimatePresence } from "motion/react";
|
||||
import { X, MapPin, User, Phone, Hash, Save, Check } from "lucide-react";
|
||||
import { toPersian, cn } from "../lib/utils";
|
||||
import { X, MapPin, Check, Save } from "lucide-react";
|
||||
import { cn } from "../lib/utils";
|
||||
import { Address } from "../lib/store/userStore";
|
||||
import { IRAN_PROVINCES, PROVINCE_CITIES } from "../lib/data/provinces";
|
||||
import SearchableSelect from "./SearchableSelect";
|
||||
@@ -31,31 +31,33 @@ export default function AddressModal({ isOpen, onClose, onSave, editingAddress }
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (editingAddress) {
|
||||
setFormData({
|
||||
title: editingAddress.title,
|
||||
receptorName: editingAddress.receptorName,
|
||||
phone: editingAddress.phone,
|
||||
province: editingAddress.province,
|
||||
city: editingAddress.city,
|
||||
detail: editingAddress.detail,
|
||||
zipCode: editingAddress.zipCode,
|
||||
isDefault: editingAddress.isDefault
|
||||
});
|
||||
} else {
|
||||
setFormData({
|
||||
title: "",
|
||||
receptorName: "",
|
||||
phone: "",
|
||||
province: "",
|
||||
city: "",
|
||||
detail: "",
|
||||
zipCode: "",
|
||||
isDefault: false
|
||||
});
|
||||
}
|
||||
setErrors({});
|
||||
setIsSubmitting(false);
|
||||
Promise.resolve().then(() => {
|
||||
if (editingAddress) {
|
||||
setFormData({
|
||||
title: editingAddress.title,
|
||||
receptorName: editingAddress.receptorName,
|
||||
phone: editingAddress.phone,
|
||||
province: editingAddress.province,
|
||||
city: editingAddress.city,
|
||||
detail: editingAddress.detail,
|
||||
zipCode: editingAddress.zipCode,
|
||||
isDefault: editingAddress.isDefault
|
||||
});
|
||||
} else {
|
||||
setFormData({
|
||||
title: "",
|
||||
receptorName: "",
|
||||
phone: "",
|
||||
province: "",
|
||||
city: "",
|
||||
detail: "",
|
||||
zipCode: "",
|
||||
isDefault: false
|
||||
});
|
||||
}
|
||||
setErrors({});
|
||||
setIsSubmitting(false);
|
||||
});
|
||||
}, [editingAddress, isOpen]);
|
||||
|
||||
const normalizeDigits = (str: string) => {
|
||||
|
||||
Reference in new issue
Block a user