feat(avatar): create DoctorAvatar component for improved doctor image handling
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
import Image from "next/image";
|
||||
import { imageUrl } from "@/helper";
|
||||
import DoctorAvatar from "@/app/component/DoctorAvatar";
|
||||
|
||||
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)
|
||||
@@ -12,15 +8,13 @@ function Head({ doctor }) {
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-start gap-[12px]">
|
||||
<Image
|
||||
<DoctorAvatar
|
||||
doctor={doctor}
|
||||
size={56}
|
||||
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">
|
||||
|
||||
Reference in New Issue
Block a user