canina/frontend/application/app/shop/page.tsx
parsa aghaei 70d58e7086
All checks were successful
Deploy Canina / deploy (push) Successful in 1m44s
feat(seo): unify dynamic SEO metadata and title formatting across backend, admin and application
2026-08-19 15:03:10 +03:30

33 lines
1.6 KiB
TypeScript

import type { Metadata } from "next";
import ArchivePage from "../../components/ArchivePage";
import { getPageMetadata } from "../../lib/seo";
export async function generateMetadata(): Promise<Metadata> {
return getPageMetadata('shop', {
canonicalPath: '/shop',
fallbackTitle: 'فروشگاه تخصصی مکمل‌های دارویی سگ و گربه',
fallbackDesc: 'خرید آنلاین انواع مکمل‌های درمانی مفاصل، پوست و مو، گوارش و ایمنی، رشد و ویتامینه سگ و گربه با ضمانت اصالت کنینا آلمان.',
});
}
export default async function Shop({ searchParams }: { searchParams: Promise<{ [key: string]: string | string[] | undefined }> }) {
const resolvedParams = await searchParams;
const category = typeof resolvedParams.category === 'string' ? resolvedParams.category : "all";
const search = typeof resolvedParams.search === 'string' ? resolvedParams.search : "";
const petType = typeof resolvedParams.petType === 'string' ? resolvedParams.petType : "all";
// Support both ?symptoms= (multi, from sidebar URL state) and ?symptom= (single, from megamenu/PDP links)
const symptomsParam = typeof resolvedParams.symptoms === 'string' ? resolvedParams.symptoms : "";
const symptomSingle = typeof resolvedParams.symptom === 'string' ? resolvedParams.symptom : "";
const symptoms = symptomsParam || (symptomSingle ? symptomSingle : "");
return (
<ArchivePage
initialCategory={category}
initialSearch={search}
initialPetType={petType}
initialSymptoms={symptoms}
/>
);
}