import Image from "next/image"; import { imageUrl } from "@/helper"; function getInitials(name) { if (!name) return ""; 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]}`; } function DoctorAvatar({ doctor, size = 72, className = "", priority = false }) { const url = doctor?.img?.[0]?.url; if (!url) { return (
{getInitials(doctor?.name)}
); } return ( image-doctor ); } export default DoctorAvatar;