The appointment info/location headers fell back to /default-doctor.jpg, which does not exist in public/, so the Next image optimizer returned 400 for doctors without a photo. Point the fallback at the existing /assets/images/doctor.png (same default used on the doctor page). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import Image from "next/image";
|
|
import { imageUrl } from "@/helper";
|
|
|
|
function Head({ doctor }) {
|
|
// تبدیل img array به string
|
|
const doctorImage = imageUrl(doctor?.img?.[0]?.url, "/assets/images/doctor.png");
|
|
|
|
// تبدیل specialties array به string
|
|
const expertiseText = doctor?.specialties
|
|
?.map((exp) => exp.name)
|
|
.join("، ") || "";
|
|
|
|
return (
|
|
<div className="flex items-center justify-start gap-[12px]">
|
|
<Image
|
|
className="
|
|
w-[48px] sm:w-[51px] md:w-[54px] lg:w-[56px]
|
|
h-[48px] sm:h-[51px] md:h-[54px] lg:h-[56px]
|
|
"
|
|
src={doctorImage}
|
|
alt="profile"
|
|
height={56}
|
|
width={56}
|
|
/>
|
|
<div className="flex flex-col items-start justify-start gap-[8px]">
|
|
<h2 className="text-[#3B3B3B] text-[12px] md:text-[14px] font-bold">
|
|
{doctor?.name}
|
|
</h2>
|
|
<h3 className="text-[#525252] text-[12px] md:text-[14px] font-medium">
|
|
تخصص: {expertiseText}
|
|
</h3>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default Head;
|