import Button from "@/components/Button"; import Table from "@/components/Table"; import type { ColumnType } from "@/components/types/TableTypes"; import { Paths } from "@/config/Paths"; import { formatDateShort, formatPrice } from "@/helpers/func"; import { usePageTitle } from "@/hooks/usePageTitle"; import { getTotalPrice } from "@/pages/designer/designerRequestForm"; import { useGetDesignRequests } from "@/pages/designer/hooks/useDesignerData"; import type { RequestDesignItemType } from "@/pages/designer/types/Types"; import { type FC, useMemo } from "react"; import { Link } from "react-router-dom"; const getInvoiceUrl = (invoiceId: string) => `${import.meta.env.VITE_INVOICE_URL}${invoiceId}`; const RequestDesignList: FC = () => { usePageTitle("لیست درخواست‌های طراحی"); const { data, isPending } = useGetDesignRequests(); const requests = data?.data ?? []; const columns = useMemo[]>( () => [ { title: "عنوان", key: "title", className: "font-medium text-black" }, { title: "تاریخ ثبت", key: "createdAt", render: (item) => formatDateShort(item.createdAt) }, { title: "زمان تحویل", key: "expectedDate", render: (item) => formatDateShort(item.expectedDate) }, { title: "تعداد صفحات", key: "count", render: (item) => item.count.toLocaleString("fa-IR") }, { title: "مبلغ", key: "totalPrice", render: (item) => `${formatPrice(getTotalPrice(item.count))} تومان`, }, { title: "وضعیت", key: "paidAt", render: (item) => { const isPaid = Boolean(item.paidAt); return ( {isPaid ? "پرداخت شده" : "در انتظار پرداخت"} ); }, }, { title: "عملیات", key: "actions", render: (item) => { if (item.paidAt) { return ; } return ( ); }, }, ], [], ); return (

درخواست‌های طراحی

هنوز درخواست طراحی ثبت نشده است. } /> ); }; export default RequestDesignList;