Fetch active specialties with number_of_doctors from GET /api/v1/specialties/doctor-counts (scoped to the current city via matchedCity.id) instead of the static specialties.json, so each specialty card shows the real doctor count. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
30 lines
1006 B
JavaScript
30 lines
1006 B
JavaScript
import Layout from "@/components/layout/StLayout";
|
|
import SpecialtiesPage from "@/components/specialties";
|
|
import { getStateInfo } from "@/lib/getStateInfo";
|
|
|
|
export async function generateMetadata() {
|
|
const { matchedCity } = await getStateInfo();
|
|
const siteName = matchedCity?.site_name || "نوبت 724";
|
|
const cityName = matchedCity?.name || "";
|
|
const title = cityName
|
|
? `تخصصهای پزشکی در ${cityName} | ${siteName}`
|
|
: `تخصصهای پزشکی | ${siteName}`;
|
|
const description = `لیست کامل تخصصهای پزشکی${cityName ? " در " + cityName : ""}. رزرو نوبت از متخصصین مختلف به صورت آنلاین.`;
|
|
return {
|
|
title,
|
|
description,
|
|
openGraph: { title, description },
|
|
};
|
|
}
|
|
|
|
async function Specialties() {
|
|
const { matchedCity } = await getStateInfo();
|
|
return (
|
|
<Layout name="/specialties">
|
|
<SpecialtiesPage cityId={matchedCity?.id ?? null} />
|
|
</Layout>
|
|
);
|
|
}
|
|
|
|
export default Specialties;
|