add state of page in url, add location and working_days on list in clinics page, fix update list clinic with page and limit value, hide pagination when list of clinic is empty, round image of doctor and appo in doctor item
This commit is contained in:
@@ -4,14 +4,19 @@ import { QueryForClinicsFilter } from "@/helper";
|
||||
import Pageguide from "@/app/component/Pageguide";
|
||||
import PaginationContent from "@/app/component/PaginationContent";
|
||||
import { request } from "@/services/response";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
function List({ limit, selected, clinics, pages, setFilteredClinics }) {
|
||||
const listPage = ["کلینیک ها", selected?.city?.name || ""];
|
||||
const [page, setPage] = useState(pages?.currentPage);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const router = useRouter();
|
||||
|
||||
const changePage = (_, num) => {
|
||||
setLoading(true);
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
searchParams.set("page", num);
|
||||
router.push(`?${searchParams.toString()}`);
|
||||
|
||||
setPage(num);
|
||||
const params = {
|
||||
|
||||
Reference in New Issue
Block a user