import { type FC } from 'react' import Button from '@/components/Button' import { Edit, ShoppingCart, TickSquare, Trash } from 'iconsax-react' import { useGetProducts } from '../hooks/useRequestData' import type { RequestType } from '../type/Types' import { clx } from '@/helpers/utils' type Props = { items: RequestType[] editingIndex: number | null onEdit: (index: number) => void onRemove: (index: number) => void onSubmit: () => void isPending: boolean } const RequestItemsList: FC = ({ items, editingIndex, onEdit, onRemove, onSubmit, isPending, }) => { const { data: productsData } = useGetProducts() const getProductTitle = (productId?: string) => productsData?.data?.find((p) => p.id === productId)?.title ?? 'محصول' return (
اقلام درخواست {items.length > 0 && ( {items.length} )}
{items.length === 0 ? (

هنوز قلمی اضافه نشده. فرم را پر کنید و روی «افزودن به لیست» بزنید.

) : ( )}
{items.length === 0 && (

حداقل یک قلم برای ثبت لازم است

)}
) } export default RequestItemsList