feat(clinic): enhance clinic details display with improved logo handling and address formatting
This commit is contained in:
@@ -3,6 +3,7 @@ import TextLoading from "@/app/component/loading/Text";
|
|||||||
import ArrowLeftD from "@/components/icons/ArrowLeftD";
|
import ArrowLeftD from "@/components/icons/ArrowLeftD";
|
||||||
import ClockClinic from "@/components/icons/ClockClinic";
|
import ClockClinic from "@/components/icons/ClockClinic";
|
||||||
import LocationClinic from "@/components/icons/LocationClinic";
|
import LocationClinic from "@/components/icons/LocationClinic";
|
||||||
|
import { imageUrl } from "@/helper";
|
||||||
import { Button } from "@mui/material";
|
import { Button } from "@mui/material";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
@@ -26,7 +27,7 @@ function ItemClinic({ setFilteredClinics, data, loading }) {
|
|||||||
width={60}
|
width={60}
|
||||||
height={60}
|
height={60}
|
||||||
className="object-cover rounded-full w-[64px] md:w-[68px] lg:w-[72px] h-[64px] md:h-[68px] lg:h-[72px]"
|
className="object-cover rounded-full w-[64px] md:w-[68px] lg:w-[72px] h-[64px] md:h-[68px] lg:h-[72px]"
|
||||||
src={data.clinic_logo?.[0]?.url || "/assets/images/logo.png"}
|
src={imageUrl(data.clinic_logo, "/assets/images/logo.png")}
|
||||||
alt="img clinic"
|
alt="img clinic"
|
||||||
/>
|
/>
|
||||||
</CircularLoading>
|
</CircularLoading>
|
||||||
@@ -40,7 +41,7 @@ function ItemClinic({ setFilteredClinics, data, loading }) {
|
|||||||
</Link>
|
</Link>
|
||||||
<TextLoading loading={loading} width={60} height={18}>
|
<TextLoading loading={loading} width={60} height={18}>
|
||||||
<p className="text-[#7E7E7E] text-[14px] font-normal">
|
<p className="text-[#7E7E7E] text-[14px] font-normal">
|
||||||
{data.doctors} پزشک
|
{data.doctors_count ?? 0} پزشک
|
||||||
</p>
|
</p>
|
||||||
</TextLoading>
|
</TextLoading>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,7 +51,7 @@ function ItemClinic({ setFilteredClinics, data, loading }) {
|
|||||||
<LocationClinic />
|
<LocationClinic />
|
||||||
<TextLoading loading={loading} width={150} height={18}>
|
<TextLoading loading={loading} width={150} height={18}>
|
||||||
<p className="text-[#7E7E7E] text-[12px] font-normal">
|
<p className="text-[#7E7E7E] text-[12px] font-normal">
|
||||||
{data.address}
|
{[data.state, data.city].filter(Boolean).join("، ") || "نامشخص"}
|
||||||
</p>
|
</p>
|
||||||
</TextLoading>
|
</TextLoading>
|
||||||
</div>
|
</div>
|
||||||
@@ -58,7 +59,10 @@ function ItemClinic({ setFilteredClinics, data, loading }) {
|
|||||||
<ClockClinic />
|
<ClockClinic />
|
||||||
<TextLoading loading={loading} width={120} height={18}>
|
<TextLoading loading={loading} width={120} height={18}>
|
||||||
<p className="text-[#7E7E7E] text-[12px] font-normal">
|
<p className="text-[#7E7E7E] text-[12px] font-normal">
|
||||||
ساعت کاری: {data.field_working_days}
|
ساعت کاری:{" "}
|
||||||
|
{data["24_7"]
|
||||||
|
? "۲۴ ساعته"
|
||||||
|
: data.field_working_days || "نامشخص"}
|
||||||
</p>
|
</p>
|
||||||
</TextLoading>
|
</TextLoading>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user