change design and data list in doctor-item & handle component appointment in doctor-item & handle functionality date-picker & fix bug appointment page & add req get appointment list

This commit is contained in:
Ehsan
2025-07-09 03:05:48 +03:30
parent f951128074
commit c6e2657e45
57 changed files with 442 additions and 445 deletions
@@ -7,7 +7,7 @@ import Image from "next/image";
import Link from "next/link";
import React from "react";
function ItemAppointment({ turn, doctor, loading }) {
function ItemAppointment({ turn, loading }) {
return (
<li
key={turn.id}
@@ -17,17 +17,19 @@ function ItemAppointment({ turn, doctor, 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={doctor?.img} width={56} height={56} alt="doctor" />
<Image src={turn?.img || ""} width={56} height={56} alt="doctor" />
</CircularLoading>
<div className="flex flex-col items-start justify-center gap-2">
<TextLoading width={60} height={15} loading={loading}>
<p className="text-[#3B3B3B] text-[14px] font-bold">
{doctor?.name}
</p>
<p className="text-[#3B3B3B] text-[14px] font-bold">{turn?.name}</p>
</TextLoading>
<TextLoading width={65} height={15} loading={loading}>
<p className="text-[#525252] text-[14px] font-medium">
تخصص: {doctor?.expertise}
تخصص:
{turn?.expertise?.map(
(item, idx) =>
`${item.name} ${turn.expertise.length === idx + 1 ? "" : "|"} `
)}
</p>
</TextLoading>
</div>
@@ -41,7 +43,7 @@ function ItemAppointment({ turn, doctor, loading }) {
</p>
</TextLoading>
</div>
<Link href={loading ? "#" : `/booking/${turn.id}`}>
<Link href={loading ? "#" : `/appointment/${turn.id}`}>
<Button
variant="contained"
className="!py-2 !px-3 xl:!px-6 gap-1"
+5 -13
View File
@@ -1,24 +1,16 @@
"use client";
import turns from "@/data/turns.json";
import { Button } from "@mui/material";
import ItemAppointment from "./ItemAppointment";
import ArrowLeftD from "@/components/icons/ArrowLeftD";
import Link from "next/link";
function AppointmentList({ doctor, loading }) {
const itemActive = turns[0];
function AppointmentList({ doctors, loading }) {
return (
<>
<ul className="hidden sticky top-[122px] sm:top-[150px] mt:top-[178px] lg:top-[206px] lg:flex w-[38%] flex-col justify-start items-center gap-8">
{[turns[0]].map((item) => (
<ItemAppointment
turn={item}
key={item.id}
doctor={doctor}
loading={loading}
/>
{doctors?.map((item) => (
<ItemAppointment turn={item} key={item.id} loading={loading} />
))}
</ul>
<div
@@ -26,9 +18,9 @@ function AppointmentList({ doctor, loading }) {
border-solid bottom-0 right-0 w-full p-4 flex items-center justify-between"
>
<p className="text-[#05BA58] text-[11px] font-normal">
اولین نوبت آزاد: {itemActive.first_free_turn}
اولین نوبت آزاد: {doctors[0]?.free_turn}
</p>
<Link href={`/booking/${itemActive.id}`}>
<Link href={`/appointment/${doctors[0]?.id}`}>
<Button
variant="contained"
className="!py-2 !px-4 gap-1 !text-[14px] !font-medium"