diff --git a/app/component/DoctorAvatar.js b/app/component/DoctorAvatar.js index 7f29d44..5e5714c 100644 --- a/app/component/DoctorAvatar.js +++ b/app/component/DoctorAvatar.js @@ -3,10 +3,11 @@ import { imageUrl } from "@/helper"; function getInitials(name) { if (!name) return ""; - const parts = name.trim().split(/\s+/).filter(Boolean); + const cleanName = name.trim().replace(/^دکتر\s+/, ""); + const parts = cleanName.split(/\s+/).filter(Boolean); if (parts.length === 0) return ""; if (parts.length === 1) return parts[0][0]; - return `${parts[0][0]}${parts[1][0]}`; + return `${parts[0][0]} - ${parts[1][0]}`; } function DoctorAvatar({ doctor, size = 72, className = "", priority = false }) { @@ -18,7 +19,9 @@ function DoctorAvatar({ doctor, size = 72, className = "", priority = false }) { style={{ width: size, height: size }} className={`flex items-center justify-center rounded-full bg-[#F8F8FF] text-[#3B3B3B] font-bold select-none ${className}`} > - {getInitials(doctor?.name)} + + {getInitials(doctor?.name)} + ); } diff --git a/components/doctor/appointmentList/ItemAppointment.js b/components/doctor/appointmentList/ItemAppointment.js index a432c29..9b8c2b8 100644 --- a/components/doctor/appointmentList/ItemAppointment.js +++ b/components/doctor/appointmentList/ItemAppointment.js @@ -3,9 +3,8 @@ import TextLoading from "@/app/component/loading/Text"; import ArrowLeftD from "@/components/icons/ArrowLeftD"; import GreenCalendarTurn from "@/components/icons/GreenCalendarTurn"; import { Button } from "@mui/material"; -import Image from "next/image"; import Link from "next/link"; -import { imageUrl } from "@/helper"; +import DoctorAvatar from "@/app/component/DoctorAvatar"; function ItemAppointment({ turn, loading, doctorSlug }) { return ( @@ -17,13 +16,7 @@ function ItemAppointment({ turn, loading, doctorSlug }) {