fix(images): resolve relative backend image URLs to absolute
API مسیرهای تصویر را نسبی برمیگرداند (/uploads/...) که next/image روی دامنه localhost میجست و 404 میداد. helper جدید imageUrl مسیرهای نسبی uploads را با NEXT_PUBLIC_API_URL کامل میکند (absolute و asset محلی دستنخورده). اعمال روی لیست/جزئیات پزشک، نوبت، گالری کلینیک، آواتارها. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import Link from "next/link";
|
||||
import CustomLoading from "./loading/Custom";
|
||||
import TextLoading from "./loading/Text";
|
||||
import CircularLoading from "./loading/Circular";
|
||||
import { imageUrl } from "@/helper";
|
||||
|
||||
// Icons
|
||||
import ArrowLeftD from "@/components/icons/ArrowLeftD";
|
||||
@@ -32,7 +33,7 @@ function ItemDoctor({ doctor, loading, setDoctors, priority = false }) {
|
||||
width={72}
|
||||
height={72}
|
||||
alt="image-doctor"
|
||||
src={doctor?.img?.[0]?.url || "/assets/images/user.png"}
|
||||
src={imageUrl(doctor?.img?.[0]?.url)}
|
||||
className="object-contain rounded-full w-[64px] md:w-[68px] lg:w-[72px] h-[64px] md:h-[68px] lg:h-[72px]"
|
||||
priority={priority}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user