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>
80 lines
3.0 KiB
JavaScript
80 lines
3.0 KiB
JavaScript
import CircularLoading from "@/app/component/loading/Circular";
|
|
import CustomLoading from "@/app/component/loading/Custom";
|
|
import TextLoading from "@/app/component/loading/Text";
|
|
import LikeDI from "@/components/icons/LikeDI";
|
|
import StarDI from "@/components/icons/StarDI";
|
|
import TickCircle from "@/components/icons/TickCircle";
|
|
import Image from "next/image";
|
|
import { imageUrl } from "@/helper";
|
|
|
|
function Title({ doctor }) {
|
|
return (
|
|
<div className="flex flex-col lg:flex-row items-center justify-start gap-[8px] lg:gap-[32px]">
|
|
<CircularLoading width={100} height={100}>
|
|
<Image
|
|
className="
|
|
object-contain rounded-full
|
|
w-[40px] sm:w-[81px] md:w-[123px] lg:w-[164px]
|
|
h-[40px] sm:h-[81px] md:h-[123px] lg:h-[164px]
|
|
"
|
|
src={imageUrl(doctor?.img?.[0]?.url)}
|
|
alt="img-doctor"
|
|
height={164}
|
|
width={164}
|
|
/>
|
|
</CircularLoading>
|
|
<div className="flex flex-col items-center lg:items-start gap-[8px] lg:gap-[16px]">
|
|
<TextLoading width={90} height={20}>
|
|
<h1 className="text-[#3B3B3B] text-[14px] sm:text-[16px] md:text-[18px] lg:text-[20px] font-bold">
|
|
{doctor?.name}
|
|
</h1>
|
|
</TextLoading>
|
|
<TextLoading width={100} height={20}>
|
|
<h3 className="text-[#525252] text-[14px] md:text-[16px] font-medium">
|
|
تخصص:
|
|
{doctor?.specialties?.map(
|
|
(item, idx) =>
|
|
`${item.name} ${doctor.specialties.length === idx + 1 ? "" : "|"} `
|
|
)}
|
|
</h3>
|
|
</TextLoading>
|
|
<div className="flex items-center justify-start gap-11">
|
|
<TextLoading width={60} height={20}>
|
|
<p className="text-[#525252] text-[16px] font-medium">
|
|
{doctor?.experience} سال تجربه
|
|
</p>
|
|
</TextLoading>
|
|
<div className="flex items-center gap-1">
|
|
<div className="hidden lg:flex">
|
|
<TickCircle />
|
|
</div>
|
|
<TextLoading width={120} height={20}>
|
|
<p className="text-[#525252] text-[12px] md:text-[14px] lg:text-[16px] font-medium">
|
|
کد نظام پزشکی: {doctor?.medical_system_code}
|
|
</p>
|
|
</TextLoading>
|
|
</div>
|
|
</div>
|
|
<CustomLoading width={160} height={25}>
|
|
<div className="flex items-center justify-start gap-2">
|
|
<div className="flex p-1 gap-0.5 items-start justify-center">
|
|
<StarDI />
|
|
<p className="text-[#616161] text-[12px] md:text-[14px] font-normal">
|
|
امتیاز: {doctor?.point}
|
|
</p>
|
|
</div>
|
|
<div className="flex p-1 items-start gap-0.5">
|
|
<LikeDI />
|
|
<p className="text-[#616161] text-[12px] md:text-[14px] font-normal">
|
|
{doctor?.satisfaction}% رضایت کاربران
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</CustomLoading>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default Title;
|