in page add doctor change data state & component & save data & request to send data & change component folder

This commit is contained in:
Ehsan
2025-07-14 04:30:50 +03:30
parent 97802a9fdf
commit 88f25cdd2e
16 changed files with 393 additions and 156 deletions
-5
View File
@@ -29,15 +29,12 @@ function ModalSearchCity() {
second: "",
});
// Load states and cities from JSON files
useEffect(() => {
// Format states data to match the structure expected by AutoCompleteSelect
const formattedStates = statesData.map((state) => ({
label: state.name,
id: state.id,
}));
// Format cities data
const formattedCities = citiesData.map((city) => ({
label: city.name,
id: city.id,
@@ -48,7 +45,6 @@ function ModalSearchCity() {
setCities(formattedCities);
}, []);
// Filter cities when state is selected
useEffect(() => {
if (selected.first) {
const selectedState = states.find(
@@ -69,7 +65,6 @@ function ModalSearchCity() {
const updateData = (event, name) => {
if (name === "first" && event !== selected.first) {
// If state changes, reset city selection
setSelected({ first: event, second: "" });
} else {
setSelected({ ...selected, [name]: event });