add first open time for appo item and change component data, remove work time in location, add loading on links in page doctor list, fix bug search city and state in clinics page

This commit is contained in:
ehsan
2025-09-18 14:30:49 +03:30
parent a6386e693f
commit 2f078eba3c
17 changed files with 115 additions and 65 deletions
@@ -5,7 +5,9 @@ import GreenCalendarTurn from "@/components/icons/GreenCalendarTurn";
import { Button } from "@mui/material";
import Image from "next/image";
import Link from "next/link";
import React from "react";
import moment from "moment-jalaali";
moment.loadPersian({ dialect: "persian-modern" });
function ItemAppointment({ turn, loading }) {
return (
@@ -17,7 +19,7 @@ function ItemAppointment({ turn, loading }) {
<span className="block w-full h-px bg-[#EFEFEF] my-4"></span>
<div className="flex items-center justify-start gap-3">
<CircularLoading width={56} height={56} loading={loading}>
<Image src={turn?.img || ""} width={56} height={56} alt="doctor" />
<Image width={56} height={56} alt="doctor" src={turn?.img[0]?.url} />
</CircularLoading>
<div className="flex flex-col items-start justify-center gap-2">
<TextLoading width={60} height={15} loading={loading}>
@@ -26,9 +28,9 @@ function ItemAppointment({ turn, loading }) {
<TextLoading width={65} height={15} loading={loading}>
<p className="text-[#525252] text-[14px] font-medium">
تخصص:
{turn?.expertise?.map(
{turn?.specialties?.map(
(item, idx) =>
`${item.name} ${turn.expertise.length === idx + 1 ? "" : "|"} `
`${item.name} ${turn.specialties.length === idx + 1 ? "" : "|"} `
)}
</p>
</TextLoading>
@@ -39,7 +41,11 @@ function ItemAppointment({ turn, loading }) {
<GreenCalendarTurn />
<TextLoading width={100} height={15} loading={loading}>
<p className="text-[#05BA58] text-[12px] font-medium">
اولین نوبت آزاد: {turn.first_free_turn || "یکشنبه 24 اردیبهشت"}
{Number(turn?.active)
? `اولین نوبت آزاد: ${moment(turn?.free_turn * 1000).format(
"dddd jD jMMMM [ساعت] HH:mm"
)}`
: "نوبت ندارد"}
</p>
</TextLoading>
</div>
+2 -2
View File
@@ -22,9 +22,9 @@ function AppointmentList({ doctors, loading }) {
border-solid bottom-0 right-0 w-full p-4 flex items-center justify-between"
>
<p className="text-[#05BA58] text-[11px] font-normal">
اولین نوبت آزاد: {doctors[0]?.free_turn}
اولین نوبت آزاد: {doctors && doctors[0]?.free_turn}
</p>
<Link href={`/appointment/${doctors[0]?.id}`}>
<Link href={`/appointment/${doctors && doctors[0]?.id}`}>
<Button
variant="contained"
className="!py-2 !px-4 gap-1 !text-[14px] !font-medium"