feat(doctor profile): implement unclaimed doctor handling and UI adjustments

This commit is contained in:
hamed
2026-07-12 10:00:03 +03:30
parent ce05e464c4
commit 42ac6645d5
5 changed files with 195 additions and 25 deletions
+4 -1
View File
@@ -57,10 +57,12 @@ export async function generateMetadata({ params }) {
`رزرو نوبت آنلاین دکتر ${doctor.name}${specialtyNames ? " متخصص " + specialtyNames : ""}${doctor.address ? " | " + doctor.address : ""}`.trim()
).slice(0, 160);
const image = imageUrl(doctor.img?.[0]?.url) || FALLBACK_IMG;
const isUnclaimed = doctor.owner_status !== "claimed";
return {
title,
description,
...(isUnclaimed && { robots: { index: false, follow: true } }),
openGraph: {
title,
description,
@@ -106,6 +108,7 @@ async function Doctor({ params }) {
const addresses = doctor ? await getDoctorAddresses(doctor.id) : [];
const specialtyNames = doctor?.specialties?.map((s) => s.name).join(" و ") || "";
const isUnclaimed = doctor?.owner_status !== "claimed";
const jsonLd = doctor
? {
"@context": "https://schema.org",
@@ -120,7 +123,7 @@ async function Doctor({ params }) {
url: imageUrl(doctor.img[0].url),
},
}),
...(Number(doctor.point) > 0 && {
...(!isUnclaimed && Number(doctor.point) > 0 && {
aggregateRating: {
"@type": "AggregateRating",
ratingValue: doctor.point,
+1 -1
View File
@@ -98,7 +98,7 @@ function cityFilterParams(scope) {
async function getDoctorUrls(baseUrl, scope) {
const doctors = await fetchAllPages('/api/v1/doctors', cityFilterParams(scope));
return doctors
.filter((d) => d?.uuid)
.filter((d) => d?.uuid && d?.owner_status === 'claimed')
.map((d) =>
withLastModified(
{