import AutoCompleteSelect from "@/app/component/element/AutoCompleteSelect"; import RadioContent from "./RadioContent"; import { FormControlLabel, Switch } from "@mui/material"; import specialties from "@/data/specialties.json"; import { addKeyToList } from "@/helper"; import { useEffect } from "react"; import { useRouter } from "next/navigation"; const group1 = ["خانم", "آقا", "هر دو"]; const group2 = ["فوق تخصص", "دکترای تخصصی", "متخصص", "دکتری"]; function Content({ data, setData }) { const router = useRouter(); const parentList = specialties.filter(item => !item.parent); const childrenList = specialties.filter(item => item.parent); const changedParentList = addKeyToList(parentList, 'label', 'name') || []; const changedChildrenList = addKeyToList(childrenList, 'label', 'name') || []; const filteredChildrenList = changedChildrenList.filter(item => item.parent === data.category.id); const changeData = (value, name) => { const current = new URLSearchParams(window.location.search); current.set(name, value.id || value); const queryString = current.toString(); router.push(`/doctors?${queryString}`) setData({ ...data, [name]: value }); } return (