import CustomTable from "@/app/component/CustomTable"; import ArrowLeftBlueD from "@/components/icons/ArrowLeftBlueD"; import { Button, TableCell, TableRow } from "@mui/material"; import Image from "next/image"; import Card from "./Card"; 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"; const STATUS_LABELS = { pending: "در انتظار پرداخت", confirmed: "تأیید شده", completed: "انجام شده", cancelled_by_user: "لغو شده", cancelled_by_doctor: "لغو توسط پزشک", expired: "منقضی شده", no_show: "عدم مراجعه", }; function List({ user, loading, setIsTurnsDetails, page, totalPages, onPageChange }) { const tableHead = [ "ردیف", "نام پزشک", "تاریخ", "ساعت", "وضعیت", "عملیات", ]; const centerTable = [0, 4]; if (!loading && (!Array.isArray(user) || user.length === 0)) { return (

نوبتی ثبت نکرده‌اید.

); } return (
{user.map((row, idx) => ( {(page - 1) * 10 + idx + 1} {row.doctor?.name || "--"} {convertTimestampToJalali(row.slot_start)} {convertTimestampToTime(row.slot_start)} {STATUS_LABELS[row.status] || row.status || "--"} ))}
{totalPages > 1 && (
)}
); } export default List;