Files
nobat724_front/components/appointment/information/Head.js
T
hamedandClaude Opus 4.8 1196aa64c6 fix(appointment): use existing doctor image as fallback
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>
2026-06-15 15:49:45 +03:30

45 lines
1.3 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-[8px] sm:gap-[11px] md:gap-[14px] lg:gap-[16px]
mt-[8px] sm:mt-[13px] md:mt-[19px] lg:mt-[24px]
mb-[12px] sm:mb-[19px] md:mb-[25px] lg:lg:mb-[32px]
"
>
<Image
className="
w-[40px] sm:w-[58px] md:w-[77px] lg:w-[95px]
h-[40px] sm:h-[58px] md:h-[77px] lg:h-[95px]
"
alt="profile doctor"
src={doctorImage}
height={95}
width={95}
/>
<div className="flex flex-col items-start justify-center gap-[8px] sm:gap-[12px] md:gap-[16px] lg:gap-[20px]">
<p className="text-[#3B3B3B] text-[14px] sm:text-[16px] md:text-[18px] lg:text-[20px] font-bold">
{doctor?.name}
</p>
<p className="text-[#616161] text-[14px] md:text-[16px] font-medium">
تخصص: {expertiseText}
</p>
</div>
</div>
);
}
export default Head;