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:
@@ -1,4 +1,5 @@
|
||||
import Image from "next/image";
|
||||
import { imageUrl } from "@/helper";
|
||||
import { Button, CircularProgress } from "@mui/material";
|
||||
|
||||
// Icons
|
||||
@@ -75,7 +76,7 @@ function ItemUser({ update, setUpdate, data }) {
|
||||
<div className="flex items-center justify-start gap-2">
|
||||
<Image
|
||||
className="!w-[32px] !h-[32px]"
|
||||
src={data.author?.picture[0]?.url}
|
||||
src={imageUrl(data.author?.picture?.[0]?.url)}
|
||||
width={40}
|
||||
height={40}
|
||||
alt="profile"
|
||||
|
||||
Reference in New Issue
Block a user