import React from "react"; import { TableBody, TableCell, TableHead, TableRow } from "@mui/material"; import Card from "../../../components/Card"; import CardHeader from "../../../components/Card/CardHeader"; import Table from "../../../components/Table"; import TableHeading from "../../../components/Table/TableHeading"; import { useI18n } from "../../../contexts/I18nContext"; import { ContribComponent } from "../../../types"; import { ArticleStock } from "../types/contrib"; const ArticleInventoryCard: ContribComponent = ({ data }) => { const { t } = useI18n(); return ( {t("Warehouse")} {t("On Hand")} {t("Allocated")} {t("Available")} .MuiTableCell-root": { borderBottom: "none" } }} > {data.length === 0 && ( {t("No inventory")} )} {data .sort((a, b) => (a.warehouse_code < b.warehouse_code ? -1 : 1)) .map((stock) => ( {stock.warehouse_code} {stock.quantity_on_hand} {stock.allocated_quantity} {stock.availability} ))}
); }; export default ArticleInventoryCard;