refactor: update appointment handling to improve data flow and display, including status management and detail views
This commit is contained in:
@@ -9,7 +9,7 @@ import UserAccountPage from "./userAccount";
|
||||
function Content({ matchedCity, params, logged }) {
|
||||
const [value, setValue] = useState(Number(params?.sidebar) || 0);
|
||||
const [isOpenSide, setIsOpenSide] = useState();
|
||||
const [isTurnsDetails, setIsTurnsDetails] = useState(false);
|
||||
const [isTurnsDetails, setIsTurnsDetails] = useState(null);
|
||||
|
||||
return (
|
||||
<DashboardPage
|
||||
|
||||
@@ -14,7 +14,7 @@ function HeadTab({
|
||||
return (
|
||||
<div className="opacity-page">
|
||||
{isTurnsDetails ? (
|
||||
<IsTurnsDetails user={user} setIsTurnsDetails={setIsTurnsDetails} />
|
||||
<IsTurnsDetails appointmentData={isTurnsDetails} setIsTurnsDetails={setIsTurnsDetails} />
|
||||
) : (
|
||||
<>
|
||||
<div className="!w-full">
|
||||
|
||||
@@ -3,23 +3,21 @@ import TextLoading from "@/app/component/loading/Text";
|
||||
import ArrowLeftCardD from "@/components/icons/ArrowLeftCardD";
|
||||
import { Button } from "@mui/material";
|
||||
import Image from "next/image";
|
||||
import { convertTimestampToJalali, convertTimestampToTime } from "@/helper";
|
||||
|
||||
function Card({ data, loading, setIsTurnsDetails }) {
|
||||
return (
|
||||
<li className="shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)] pb-[8px] bg-[#FFF] rounded-[8px]">
|
||||
<div className="flex items-center justify-start gap-[8px] p-[12px]">
|
||||
<CircularLoading width={32} height={32} loading={loading}>
|
||||
<Image width={32} height={32} alt="profile" src={data.image} />
|
||||
</CircularLoading>
|
||||
<div className="flex flex-col items-start justify-center gap-[8px]">
|
||||
<TextLoading loading={loading} width={65} height={18}>
|
||||
<TextLoading loading={loading} width={120} height={18}>
|
||||
<p className="text-[#616161] text-[14px] font-medium">
|
||||
{data.name}
|
||||
{data.doctor?.name || "--"}
|
||||
</p>
|
||||
</TextLoading>
|
||||
<TextLoading loading={loading} width={50} height={18}>
|
||||
<TextLoading loading={loading} width={100} height={18}>
|
||||
<p className="text-[#7E7E7E] text-[14px] font-normal">
|
||||
{data.expertise}
|
||||
{data.doctor?.specialty?.name || "--"}
|
||||
</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
@@ -33,7 +31,7 @@ function Card({ data, loading, setIsTurnsDetails }) {
|
||||
</TextLoading>
|
||||
<TextLoading loading={loading} width={110} height={18}>
|
||||
<p className="text-[#525252] text-[14px] font-medium">
|
||||
{data.date}
|
||||
{convertTimestampToJalali(data.start_time)}
|
||||
</p>
|
||||
</TextLoading>
|
||||
</li>
|
||||
@@ -43,21 +41,16 @@ function Card({ data, loading, setIsTurnsDetails }) {
|
||||
</TextLoading>
|
||||
<TextLoading loading={loading} width={60} height={18}>
|
||||
<p className="text-[#525252] text-[14px] font-medium">
|
||||
{data.time}
|
||||
{data.slot?.time || convertTimestampToTime(data.start_time)}
|
||||
</p>
|
||||
</TextLoading>
|
||||
</li>
|
||||
</ul>
|
||||
<div className="mt-[12px] flex items-center justify-between px-[12px]">
|
||||
<TextLoading loading={loading} width={120} height={18}>
|
||||
<p className="text-[#7E7E7E] text-[12px] font-normal">
|
||||
مبلغ پیش پرداخت: {data.amount} تومان
|
||||
</p>
|
||||
</TextLoading>
|
||||
<div className="mt-[12px] flex items-center justify-end px-[12px]">
|
||||
<TextLoading loading={loading} width={80} height={25}>
|
||||
<Button
|
||||
className="!flex !p-1 !items-center !justify-end !gap-[2px]"
|
||||
onClick={() => setIsTurnsDetails(true)}
|
||||
onClick={() => setIsTurnsDetails(data)}
|
||||
variant="text"
|
||||
>
|
||||
مشاهده
|
||||
|
||||
@@ -1,12 +1,37 @@
|
||||
import Tabs from "@/app/component/Tabs";
|
||||
import { Button } from "@mui/material";
|
||||
|
||||
const listTab = ["نوبت های جاری", "نوبت های انجام شده"];
|
||||
const listTab = [
|
||||
"همه",
|
||||
"در انتظار پرداخت",
|
||||
"رزرو شده",
|
||||
"ویزیت شده",
|
||||
"لغو خودکار",
|
||||
"تکمیل شده",
|
||||
];
|
||||
|
||||
function Head({ status, setStatus }) {
|
||||
const statusMap = {
|
||||
0: undefined, // all
|
||||
1: "waiting_for_payment",
|
||||
2: "reserved",
|
||||
3: "visited",
|
||||
4: "auto_cancel_unpaid",
|
||||
5: "completed",
|
||||
};
|
||||
|
||||
const handleChange = (e, value) => {
|
||||
setStatus(statusMap[value]);
|
||||
};
|
||||
|
||||
const getCurrentIndex = () => {
|
||||
const entries = Object.entries(statusMap);
|
||||
const found = entries.find(([_, val]) => val === status);
|
||||
return found ? parseInt(found[0]) : 0;
|
||||
};
|
||||
|
||||
function Head({ isDone, setIsDone }) {
|
||||
return (
|
||||
<div className="flex items-center justify-start gap-[32px] mt-[24px] sm:mt-[26px] md:mt-[28px] lg:mt-[30px]">
|
||||
<div className="block w-full lg:hidden">
|
||||
<div className="flex items-center justify-start mt-[24px] sm:mt-[26px] md:mt-[28px] lg:mt-[30px]">
|
||||
<div className="block w-full">
|
||||
<Tabs
|
||||
style={{
|
||||
".MuiTabs-indicator": {
|
||||
@@ -33,36 +58,13 @@ function Head({ isDone, setIsDone }) {
|
||||
}}
|
||||
color="#5559CE"
|
||||
listTab={listTab}
|
||||
value={isDone ? 0 : 1}
|
||||
handleChange={(e, value) => setIsDone(!!!value)}
|
||||
value={getCurrentIndex()}
|
||||
handleChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
className={`!hidden lg:!flex !border !border-solid !py-[8px] !shadow-none !px-[12px] !text-[16px] !font-medium
|
||||
${
|
||||
isDone
|
||||
? "!bg-transparent !border-[#5559CE] !text-[#5559CE]"
|
||||
: "!text-[#EFEFEF] !border-transparent"
|
||||
}`}
|
||||
onClick={() => setIsDone(!isDone)}
|
||||
variant="contained"
|
||||
>
|
||||
نوبت های جاری
|
||||
</Button>
|
||||
<Button
|
||||
className={`!hidden lg:!flex !border !border-solid !py-[8px] !shadow-none !px-[12px] !text-[16px] !font-medium
|
||||
${
|
||||
!isDone
|
||||
? "!bg-transparent !border-[#5559CE] !text-[#5559CE]"
|
||||
: "!text-[#EFEFEF] !border-transparent"
|
||||
}`}
|
||||
onClick={() => setIsDone(!isDone)}
|
||||
variant="contained"
|
||||
>
|
||||
نوبت های انجام شده
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Head;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import CircularLoading from "@/app/component/loading/Circular";
|
||||
import TextLoading from "@/app/component/loading/Text";
|
||||
import CustomLoading from "@/app/component/loading/Custom";
|
||||
import Pagination from "@/app/component/Pagination";
|
||||
import { convertTimestampToJalali, convertTimestampToTime } from "@/helper";
|
||||
|
||||
function List({ user, loading, setIsTurnsDetails, page, totalPages, onPageChange }) {
|
||||
const tableHead = [
|
||||
@@ -15,10 +16,9 @@ function List({ user, loading, setIsTurnsDetails, page, totalPages, onPageChange
|
||||
"تخصص",
|
||||
"تاریخ",
|
||||
"ساعت",
|
||||
"مبلغ (تومان)",
|
||||
"عملیات",
|
||||
];
|
||||
const centerTable = [0, 5];
|
||||
const centerTable = [0, 4];
|
||||
|
||||
return (
|
||||
<div className="!mt-[24px]">
|
||||
@@ -31,7 +31,7 @@ function List({ user, loading, setIsTurnsDetails, page, totalPages, onPageChange
|
||||
>
|
||||
<TableCell className="!pr-[18px] !text-nowrap" align="center">
|
||||
<TextLoading width={15} height={18} loading={loading}>
|
||||
{idx + 1}
|
||||
{(page - 1) * 10 + idx + 1}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
@@ -39,34 +39,24 @@ function List({ user, loading, setIsTurnsDetails, page, totalPages, onPageChange
|
||||
component="th"
|
||||
scope="row"
|
||||
>
|
||||
<div className="flex items-center justify-start gap-[8px] !text-nowrap">
|
||||
<CircularLoading width={32} height={32} loading={loading}>
|
||||
<Image
|
||||
src={row.image}
|
||||
alt="doctor"
|
||||
height={32}
|
||||
width={32}
|
||||
/>
|
||||
</CircularLoading>
|
||||
<TextLoading width={40} height={18} loading={loading}>
|
||||
{row.name}
|
||||
</TextLoading>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
className="!text-start !pr-[18px] !text-nowrap"
|
||||
align="right"
|
||||
>
|
||||
<TextLoading width={50} height={18} loading={loading}>
|
||||
{row.expertise}
|
||||
<TextLoading width={120} height={18} loading={loading}>
|
||||
{row.doctor?.name || "--"}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
className="!text-start !pr-[18px] !text-nowrap"
|
||||
align="right"
|
||||
>
|
||||
<TextLoading width={50} height={18} loading={loading}>
|
||||
{row.date}
|
||||
<TextLoading width={100} height={18} loading={loading}>
|
||||
{row.doctor?.specialty?.name || "--"}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
className="!text-start !pr-[18px] !text-nowrap"
|
||||
align="right"
|
||||
>
|
||||
<TextLoading width={80} height={18} loading={loading}>
|
||||
{convertTimestampToJalali(row.start_time)}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
@@ -74,22 +64,14 @@ function List({ user, loading, setIsTurnsDetails, page, totalPages, onPageChange
|
||||
align="right"
|
||||
>
|
||||
<TextLoading width={50} height={18} loading={loading}>
|
||||
{row.time}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
className="!text-center !pr-[18px] !text-nowrap"
|
||||
align="right"
|
||||
>
|
||||
<TextLoading width={50} height={18} loading={loading}>
|
||||
{row.amount}
|
||||
{row.slot?.time || convertTimestampToTime(row.start_time)}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell className="!pr-[18px] !text-nowrap" align="right">
|
||||
<CustomLoading width={80} height={22} loading={loading}>
|
||||
<Button
|
||||
className="!flex !p-1 !items-center !justify-start !gap-[4px] !text-[14px] !font-bold !text-[#5559CE]"
|
||||
onClick={() => setIsTurnsDetails(true)}
|
||||
onClick={() => setIsTurnsDetails(row)}
|
||||
variant="text"
|
||||
>
|
||||
مشاهده جزئیات
|
||||
|
||||
@@ -7,7 +7,7 @@ import { request } from "@/services/response";
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
function Turns({ user, setIsTurnsDetails, loading }) {
|
||||
const [isDone, setIsDone] = useState(true);
|
||||
const [status, setStatus] = useState(undefined);
|
||||
const [appointments, setAppointments] = useState([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [page, setPage] = useState(1);
|
||||
@@ -31,16 +31,27 @@ function Turns({ user, setIsTurnsDetails, loading }) {
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await request.getMyAppointments(userId, {
|
||||
const params = {
|
||||
page,
|
||||
limit: 10,
|
||||
});
|
||||
};
|
||||
|
||||
if (status) {
|
||||
params.status = status;
|
||||
}
|
||||
|
||||
const response = await request.getMyAppointments(userId, params);
|
||||
|
||||
if (response?.data) {
|
||||
setAppointments(response.data);
|
||||
if (response.page) {
|
||||
setTotalPages(response.page.totalPages);
|
||||
setTotalPages(response.page.totalPages || 1);
|
||||
} else {
|
||||
setTotalPages(1);
|
||||
}
|
||||
} else {
|
||||
setAppointments([]);
|
||||
setTotalPages(1);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching appointments:", error);
|
||||
@@ -50,18 +61,23 @@ function Turns({ user, setIsTurnsDetails, loading }) {
|
||||
};
|
||||
|
||||
fetchAppointments();
|
||||
}, [page]);
|
||||
}, [page, status]);
|
||||
|
||||
const handlePageChange = (event, value) => {
|
||||
setPage(value);
|
||||
};
|
||||
|
||||
const handleStatusChange = (newStatus) => {
|
||||
setStatus(newStatus);
|
||||
setPage(1); // Reset to first page when status changes
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="opacity-page">
|
||||
<p className="text-[#3B3B3B] hidden md:flex text-[16px] font-bold">
|
||||
تاریخچه نوبت ها
|
||||
</p>
|
||||
<Head isDone={isDone} setIsDone={setIsDone} />
|
||||
<Head status={status} setStatus={handleStatusChange} />
|
||||
<List
|
||||
loading={isLoading}
|
||||
setIsTurnsDetails={setIsTurnsDetails}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import CircularLoading from "@/app/component/loading/Circular";
|
||||
import TextLoading from "@/app/component/loading/Text";
|
||||
import CalendarD from "@/components/icons/CalendarD";
|
||||
import CallD from "@/components/icons/CallD";
|
||||
@@ -6,35 +5,24 @@ import ClockClinic from "@/components/icons/ClockClinic";
|
||||
import DownloadD from "@/components/icons/DownloadD";
|
||||
import LocationClinic from "@/components/icons/LocationClinic";
|
||||
import RoutingC from "@/components/icons/RoutingC";
|
||||
import TicketD from "@/components/icons/TicketD";
|
||||
import { Button } from "@mui/material";
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
import { convertTimestampToJalali, convertTimestampToTime } from "@/helper";
|
||||
|
||||
function DetailLg({ user, loading }) {
|
||||
const data = user.turns.done[1];
|
||||
function DetailLg({ appointmentData, loading }) {
|
||||
|
||||
return (
|
||||
<div className="lg:mt-[18px] hidden md:block">
|
||||
<div className="flex md:mt-[24px] lg:mt-0 items-center justify-start gap-[8px] md:gap-[12px] lg:gap-[16px]">
|
||||
<CircularLoading width={95} height={95} loading={loading}>
|
||||
<Image
|
||||
width={95}
|
||||
height={95}
|
||||
alt="profile"
|
||||
src={data.image}
|
||||
className="w-[32px] h-[32px] sm:w-[53px] sm:h-[53px] md:w-[74px] md:h-[74px] lg:w-[95px] lg:h-[95px]"
|
||||
/>
|
||||
</CircularLoading>
|
||||
<div className="flex flex-col items-start justify-center gap-[20px]">
|
||||
<TextLoading loading={loading} width={70} height={18}>
|
||||
<p className="text-[#3B3B3B] text-[14px] sm:text-[16px] md:text-[18px] lg:text-[20px] font-medium">
|
||||
{data.name}
|
||||
{appointmentData?.doctor?.name}
|
||||
</p>
|
||||
</TextLoading>
|
||||
<TextLoading loading={loading} width={80} height={18}>
|
||||
<p className="text-[#616161] text-[14px] md:text-[15px] lg:text-[16px] font-medium">
|
||||
تخصص: {data.expertise}
|
||||
تخصص: {appointmentData?.doctor?.specialty?.name}
|
||||
</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
@@ -47,7 +35,7 @@ function DetailLg({ user, loading }) {
|
||||
<p className="text-[#616161] text-[14px] lg:text-[20px] font-medium">
|
||||
تاریخ نوبت:{" "}
|
||||
<span className="text-[#2F2F2F] text-[14px] lg:text-[20px] font-bold">
|
||||
{data.date_turn}
|
||||
{convertTimestampToJalali(appointmentData?.start_time)}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
@@ -58,7 +46,7 @@ function DetailLg({ user, loading }) {
|
||||
<p className="text-[#616161] text-[14px] lg:text-[20px] font-medium">
|
||||
زمان نوبت:{" "}
|
||||
<span className="text-[#2F2F2F] text-[14px] lg:text-[20px] font-bold">
|
||||
ساعت {data.time}
|
||||
ساعت {appointmentData?.slot?.time}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
@@ -71,13 +59,17 @@ function DetailLg({ user, loading }) {
|
||||
<p className="text-[#616161] text-[14px] lg:text-[16px] font-normal">
|
||||
آدرس:{" "}
|
||||
<span className="text-[#2F2F2F] text-[14px] lg:text-[16px] font-normal">
|
||||
{data.location}
|
||||
{appointmentData?.address?.address}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</TextLoading>
|
||||
<TextLoading loading={loading} width={120} height={30}>
|
||||
<Button className="!py-[8px] !px-[12px] !gap-[8px]" variant="text">
|
||||
<Button
|
||||
className="!py-[8px] !px-[12px] !gap-[8px]"
|
||||
variant="text"
|
||||
onClick={() => appointmentData?.address?.map && window.open(appointmentData.address.map, '_blank')}
|
||||
>
|
||||
<RoutingC />
|
||||
<p className="text-[#5559CE] text-[14px] font-medium">
|
||||
مسیریابی آدرس
|
||||
@@ -91,23 +83,12 @@ function DetailLg({ user, loading }) {
|
||||
<p className="text-[#616161] text-[14px] lg:text-[16px] font-normal">
|
||||
تلفن:{" "}
|
||||
<span className="text-[#2F2F2F] text-[14px] lg:text-[16px] font-normal">
|
||||
{data.phone}
|
||||
{appointmentData?.address?.phone}
|
||||
</span>
|
||||
</p>
|
||||
</li>
|
||||
</TextLoading>
|
||||
</ul>
|
||||
<div className="flex items-center gap-[4px] w-fit">
|
||||
<TextLoading loading={loading} width={150} height={18}>
|
||||
<TicketD />
|
||||
<p className="text-[#616161] text-[14px] lg:text-[20px] font-medium">
|
||||
مبلغ پرداخت شده :{" "}
|
||||
<span className="text-[#2F2F2F] text-[14px] lg:text-[20px] font-bold">
|
||||
{data.amount_paid} تومان
|
||||
</span>
|
||||
</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
<Button
|
||||
className="!px-[12px] !hidden md:!flex !mt-[24px] !py-[8px] !border !border-solid !border-[#D7D7D7] !rounded-[4px] !w-fit !items-center !justify-center !gap-[4px]"
|
||||
variant="outlined"
|
||||
|
||||
@@ -1,30 +1,24 @@
|
||||
import RoutingC from "@/components/icons/RoutingC";
|
||||
import TicketD from "@/components/icons/TicketD";
|
||||
import { Button } from "@mui/material";
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
import ButtonData from "./ButtonData";
|
||||
import CircularLoading from "@/app/component/loading/Circular";
|
||||
import TextLoading from "@/app/component/loading/Text";
|
||||
import { convertTimestampToJalali } from "@/helper";
|
||||
|
||||
function DetailSm({ user, loading }) {
|
||||
const data = user.turns.done[1];
|
||||
function DetailSm({ appointmentData, loading }) {
|
||||
|
||||
return (
|
||||
<div className="mt-[20px] block md:hidden">
|
||||
<div className="flex items-center justify-start gap-[8px]">
|
||||
<CircularLoading width={32} height={32} loading={loading}>
|
||||
<Image src={data.image} alt="profile" height={32} width={32} />
|
||||
</CircularLoading>
|
||||
<div className="flex flex-col justify-center items-start gap-[8px]">
|
||||
<TextLoading loading={loading} width={60} height={14}>
|
||||
<p className="text-[#616161] text-[14px] font-medium">
|
||||
{data.name}
|
||||
{appointmentData?.doctor?.name}
|
||||
</p>
|
||||
</TextLoading>
|
||||
<TextLoading loading={loading} width={70} height={14}>
|
||||
<p className="text-[#7E7E7E] text-[14px] font-normal">
|
||||
{data.expertise}
|
||||
{appointmentData?.doctor?.specialty?.name}
|
||||
</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
@@ -38,7 +32,7 @@ function DetailSm({ user, loading }) {
|
||||
</TextLoading>
|
||||
<TextLoading loading={loading} width={55} height={16}>
|
||||
<p className="text-[#525252] text-[16px] font-medium">
|
||||
{data.date}
|
||||
{convertTimestampToJalali(appointmentData?.start_time)}
|
||||
</p>
|
||||
</TextLoading>
|
||||
</li>
|
||||
@@ -49,7 +43,7 @@ function DetailSm({ user, loading }) {
|
||||
</TextLoading>
|
||||
<TextLoading loading={loading} width={60} height={16}>
|
||||
<p className="text-[#525252] text-[16px] font-medium">
|
||||
{data.time}
|
||||
{appointmentData?.slot?.time}
|
||||
</p>
|
||||
</TextLoading>
|
||||
</li>
|
||||
@@ -57,13 +51,14 @@ function DetailSm({ user, loading }) {
|
||||
<li className="flex flex-wrap gap-x-[12px] gap-y-[12px] items-center w-full justify-between">
|
||||
<TextLoading loading={loading} width={200} height={16}>
|
||||
<p className="text-[#7E7E7E] text-[14px] font-normal">
|
||||
آدرس:<span className="text-[#616161]">{data.location}</span>
|
||||
آدرس:<span className="text-[#616161]">{appointmentData?.address?.address}</span>
|
||||
</p>
|
||||
</TextLoading>
|
||||
<TextLoading loading={loading} width={130} height={40}>
|
||||
<Button
|
||||
className="!py-[8px] !border-[#EFEFEF] !px-[12px] !gap-[8px]"
|
||||
variant="outlined"
|
||||
onClick={() => appointmentData?.address?.map && window.open(appointmentData.address.map, '_blank')}
|
||||
>
|
||||
<RoutingC />
|
||||
<p className="text-[#5559CE] text-[14px] font-medium">
|
||||
@@ -74,28 +69,9 @@ function DetailSm({ user, loading }) {
|
||||
</li>
|
||||
<TextLoading loading={loading} width={100} height={18}>
|
||||
<p className="text-[#7E7E7E] text-[14px] font-normal mt-[12px]">
|
||||
تلفن: <span className="text-[#616161]">{data.phone}</span>
|
||||
تلفن: <span className="text-[#616161]">{appointmentData?.address?.phone}</span>
|
||||
</p>
|
||||
</TextLoading>
|
||||
<span className="block w-full h-px bg-[#EFEFEF] mt-[12px] mb-[16px]"></span>
|
||||
<li className="flex items-center justify-between w-full">
|
||||
<TextLoading loading={loading} width={120} height={18}>
|
||||
<div className="flex items-center gap-[4px] w-fit">
|
||||
<TicketD />
|
||||
<p className="text-[#616161] text-[14px] lg:text-[20px] font-medium">
|
||||
مبلغ پرداخت شده :{" "}
|
||||
<span className="text-[#2F2F2F] text-[14px] lg:text-[20px] font-bold">
|
||||
{data.amount_paid} تومان
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</TextLoading>
|
||||
<TextLoading loading={loading} width={60} height={18}>
|
||||
<p className="text-[#616161] text-[14px] font-bold">
|
||||
{data.amount_paid} تومان
|
||||
</p>
|
||||
</TextLoading>
|
||||
</li>
|
||||
</ul>
|
||||
<ButtonData loading={loading} />
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@ function Head({ setIsTurnsDetails }) {
|
||||
<div className="hidden md:flex flex-wrap gap-x-[24px] gap-y-[12px] items-center justify-between">
|
||||
<div className="flex items-center justify-start gap-[12px] sm:gap-[16px] md:gap-[20px] lg:gap-[24px]">
|
||||
<Button
|
||||
onClick={() => setIsTurnsDetails(false)}
|
||||
onClick={() => setIsTurnsDetails(null)}
|
||||
className="!p-[6px] !border !border-solid !border-[#EFEFEF] !rounded-[4px] !min-w-0"
|
||||
>
|
||||
<ArrowRightS />
|
||||
|
||||
@@ -2,12 +2,12 @@ import DetailLg from "./DetailLg";
|
||||
import DetailSm from "./DetailSm";
|
||||
import Head from "./Head";
|
||||
|
||||
function IsTurnsDetails({ user, setIsTurnsDetails }) {
|
||||
function IsTurnsDetails({ appointmentData, setIsTurnsDetails }) {
|
||||
return (
|
||||
<div className="md:py-[20px] md:px-[24px] opacity-page">
|
||||
<Head setIsTurnsDetails={setIsTurnsDetails} />
|
||||
<DetailLg user={user} loading={false} />
|
||||
<DetailSm user={user} loading={false} />
|
||||
<DetailLg appointmentData={appointmentData} loading={false} />
|
||||
<DetailSm appointmentData={appointmentData} loading={false} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user