import React from 'react'; import CardBox from '../CardBox'; import dataFormatter from '../../helpers/dataFormatter'; import ListActionsPopover from "../ListActionsPopover"; import {useAppSelector} from "../../stores/hooks"; import {Pagination} from "../Pagination"; import LoadingSpinner from "../LoadingSpinner"; import Link from 'next/link'; type Props = { inventory: any[]; loading: boolean; onDelete: (id: string) => void; currentPage: number; numPages: number; onPageChange: (page: number) => void; }; const ListInventory = ({ inventory, loading, onDelete, currentPage, numPages, onPageChange }: Props) => { const corners = useAppSelector((state) => state.style.corners); const bgColor = useAppSelector((state) => state.style.cardsColor); return ( <>
{loading && } {!loading && inventory.map((item) => (

ProductName

{ item.product_name }

AvailableQuantity

{ item.available_quantity }

ReservedQuantity

{ item.reserved_quantity }

ReturnedQuantity

{ item.returned_quantity }

Picture

{ item.picture }

))} {!loading && inventory.length === 0 && (

No data to display

)}
) }; export default ListInventory