import AutoCompleteSelect from "@/app/component/element/AutoCompleteSelect"; import RadioContent from "./RadioContent"; import { FormControlLabel, Switch } from "@mui/material"; import { useRouter } from "next/navigation"; import { filterList } from "@/helper"; const gender = [ { id: "woman", label: "زن" }, { id: "man", label: "مرد" }, { id: "هر دو", label: "all" }, ] const dgree = [ { id: "general", label: "پزشک عمومی" }, { id: "specialist", label: "پزشک متخصص" }, { id: "subspecialistplus", label: "پزشک فوق تخصص" }, { id: "all", label: "همه موارد" }, ]; function Content({ data, setData }) { const router = useRouter(); const { parentList, childrenList } = filterList(data); console.log('parentList', parentList); const changeUrl = (value, name, removeSpecialties) => { const current = new URLSearchParams(window.location.search); current.set(name, value.id || value); if (removeSpecialties) { current.delete("specialties"); } const queryString = current.toString(); router.push(`/doctors?${queryString}`); }; const changeData = (value, name, removeSpecialties) => { changeUrl(value, name, removeSpecialties); const newData = data; newData[name] = value; if (removeSpecialties) { newData.specialties = ""; } setData(newData); }; return (