- Add metadata to login and login-verify pages to prevent indexing. - Update robots.txt to disallow additional sensitive paths. - Enhance sitemap generation to filter by city and include accurate last modified dates. - Refactor canonical URL generation to support multi-domain architecture, ensuring self-canonicalization for city domains. - Remove deprecated CanonicalHandler component and streamline canonical URL handling. - Introduce safe JSON-LD output to prevent XSS vulnerabilities. - Add payment layout with appropriate metadata to prevent indexing. - Conduct a comprehensive technical SEO audit and implement necessary fixes across the application.
64 lines
1.8 KiB
JavaScript
64 lines
1.8 KiB
JavaScript
"use client";
|
|
|
|
import { Pagination, PaginationItem, useMediaQuery, useTheme } from "@mui/material";
|
|
import { usePathname, useSearchParams } from "next/navigation";
|
|
|
|
function PaginationContent({ page, pageDetail, changePage, limit = 12 }) {
|
|
const theme = useTheme();
|
|
const isSmall = useMediaQuery(theme.breakpoints.down("sm"));
|
|
const pathname = usePathname();
|
|
const searchParams = useSearchParams();
|
|
|
|
const count = Math.ceil(pageDetail.totalRecords / limit);
|
|
|
|
// href واقعی برای خزندهها؛ کلیک کاربر همچنان SPA میماند (preventDefault + onChange)
|
|
const buildHref = (pageNum) => {
|
|
const params = new URLSearchParams(searchParams.toString());
|
|
params.set("page", String(pageNum));
|
|
return `${pathname}?${params.toString()}`;
|
|
};
|
|
|
|
return (
|
|
<Pagination
|
|
count={count}
|
|
page={page || 1}
|
|
size={isSmall ? "small" : "medium"}
|
|
onChange={changePage}
|
|
color="primary"
|
|
className={(!count || count < 2) && "!hidden"}
|
|
renderItem={(item) => {
|
|
const crawlable =
|
|
item.page && item.page >= 1 && item.page <= count && !item.disabled;
|
|
return (
|
|
<PaginationItem
|
|
{...item}
|
|
{...(crawlable && {
|
|
component: "a",
|
|
href: buildHref(item.page),
|
|
onClick: (event) => {
|
|
event.preventDefault();
|
|
item.onClick?.(event);
|
|
},
|
|
})}
|
|
/>
|
|
);
|
|
}}
|
|
sx={{
|
|
"& .MuiPaginationItem-root": {
|
|
color: "#616161",
|
|
fontSize: "16px",
|
|
fontWeight: "500",
|
|
},
|
|
"& .MuiPaginationItem-root.Mui-selected": {
|
|
color: "#F8F8FF",
|
|
},
|
|
"& .MuiSvgIcon-root": {
|
|
rotate: "180deg !important",
|
|
},
|
|
}}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default PaginationContent;
|