diff --git a/app/component/ItemDoctor.js b/app/component/ItemDoctor.js index 9b48d81..92932e8 100644 --- a/app/component/ItemDoctor.js +++ b/app/component/ItemDoctor.js @@ -39,7 +39,7 @@ function ItemDoctor({ doctor, loading, setDoctors, priority = false }) { - {doctor?.name} + {doctor?.display_name || doctor?.name} @@ -92,13 +92,13 @@ function ItemDoctor({ doctor, loading, setDoctors, priority = false }) { {/* Arrow */} diff --git a/app/doctor/[slug]/page.js b/app/doctor/[slug]/page.js index 7793998..3507261 100644 --- a/app/doctor/[slug]/page.js +++ b/app/doctor/[slug]/page.js @@ -76,9 +76,13 @@ export async function generateMetadata({ params }) { .replace(/<[^>]*>/g, "") .replace(/\s+/g, " ") .trim(); + // doctor.address آرایهای از آبجکت آدرس است؛ متن آدرس یا نام شهر را میگیریم + // (الحاق مستقیم آرایه «[object Object]» میساخت). + const firstAddress = Array.isArray(doctor.address) ? doctor.address[0] : null; + const addressText = firstAddress?.address || firstAddress?.city?.name || ""; const description = ( detailText || - `رزرو نوبت آنلاین ${doctorTitle(doctor.name)}${specialtyNames ? " متخصص " + specialtyNames : ""}${doctor.address ? " | " + doctor.address : ""}`.trim() + `رزرو نوبت آنلاین ${doctorTitle(doctor.name)}${specialtyNames ? " متخصص " + specialtyNames : ""}${addressText ? " | " + addressText : ""}`.trim() ).slice(0, 160); const image = imageUrl(doctor.img?.[0]?.url) || FALLBACK_IMG; // C1-b — پزشک به دامنهٔ شهر خودش canonical میشود، روی هر دامنهای که سرو شود.
- {doctor?.name} + {doctor?.display_name || doctor?.name}