import CustomTable from "@/app/component/CustomTable"; import { TableCell, TableRow } from "@mui/material"; import Image from "next/image"; import Card from "./Card"; import TextLoading from "@/app/component/loading/Text"; import CustomLoading from "@/app/component/loading/Custom"; import CircularLoading from "@/app/component/loading/Circular"; import { convertTimestampToJalali, convertTimestampToTime } from "@/helper"; import Pagination from "@/app/component/Pagination"; import Link from "next/link"; function List({ user, loading, page, totalPages, onPageChange }) { const tableHead = [ "ردیف", "شناسه", "نام پزشک", "تاریخ", "ساعت", "مبلغ (تومان)", "وضعیت", ]; const centerTable = [0, 4, 5]; return (
{user.turns.done.map((row, idx) => ( {idx + 1} {row.id} {row.appointment_details?.doctor_name || "--"} {convertTimestampToJalali(row.appointment_details?.start_time)} {convertTimestampToTime(row.appointment_details?.start_time)} {row.amount ? row.amount.toLocaleString('fa-IR') : "--"}
{row.status === "received" ? "پرداخت شده" : row.status === "pending" ? "در انتظار" : "لغو شده"}
))}
{totalPages > 1 && (
)}
); } export default List;