import Card from "@material-ui/core/Card"; import { createStyles, Theme, withStyles, WithStyles } from "@material-ui/core/styles"; import Table from "@material-ui/core/Table"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableRow from "@material-ui/core/TableRow"; import Typography from "@material-ui/core/Typography"; import KeyboardArrowRight from "@material-ui/icons/KeyboardArrowRight"; import React from "react"; import Skeleton from "@saleor/components/Skeleton"; import i18n from "../../../i18n"; const styles = (theme: Theme) => createStyles({ arrowIcon: { width: theme.spacing.unit * 4 }, tableRow: { cursor: "pointer" } }); interface HomeNotificationTableProps extends WithStyles { ordersToCapture: number; ordersToFulfill: number; productsOutOfStock: number; onOrdersToFulfillClick: () => void; onOrdersToCaptureClick: () => void; onProductsOutOfStockClick: () => void; } const HomeNotificationTable = withStyles(styles, { name: "HomeNotificationTable" })( ({ classes, onOrdersToCaptureClick, onOrdersToFulfillClick, onProductsOutOfStockClick, ordersToCapture, ordersToFulfill, productsOutOfStock }: HomeNotificationTableProps) => { return ( {ordersToFulfill === undefined ? ( ) : ordersToFulfill === 0 ? ( {i18n.t("No orders ready to fulfill")} ) : ( {{ amount }} Orders are ready to fulfill", { amount: ordersToFulfill } ) }} /> )} {ordersToCapture === undefined ? ( ) : ordersToCapture === 0 ? ( {i18n.t("No payments waiting for capture")} ) : ( {{ amount }} Payments to capture", { amount: ordersToCapture } ) }} /> )} {productsOutOfStock === undefined ? ( ) : productsOutOfStock === 0 ? ( {i18n.t("No products out of stock")} ) : ( {{ amount }} Products out of stock", { amount: productsOutOfStock } ) }} /> )}
); } ); HomeNotificationTable.displayName = "HomeNotificationTable"; export default HomeNotificationTable;