import React from 'react'; import superagent from 'superagent'; import { fromUnixTime, formatDistanceToNow } from "date-fns"; import { formatInTimeZone } from 'date-fns-tz'; import { Table, Statistic, Label, Button, Icon, Message, Image } from 'semantic-ui-react' import constants, { DEFAULT_TIMEZONE } from '../CloudApi/Constants.js'; import * as ApiUtils from '../CloudApi/ApiUtils.js'; import InventoryWrapper from './InventoryWrapper.jsx'; import InventoryItemPickingHint from './InventoryItemPickingHint.jsx'; export default class BigShipmentInventorySlotsTable extends React.Component { renderInventorySlotRow(inventorySlot) { let cardColor = "grey"; if (inventorySlot.status === "InventoryItemAdded") { cardColor = "green"; } else if (inventorySlot.status === "NothingInStock") { cardColor = "red"; } console.log(inventorySlot); return ( {ApiUtils.splitUpperCamelCase(inventorySlot.productType)} {inventorySlot.expectedSerialNumber || inventorySlot.expectedSerialNumberPattern} {inventorySlot.status === "NothingInStock" ? : } ); } render() { return ( Item Type Serial Number Item Status Info {this.props.bigShipment.inventorySlots.map((item, index) => { return this.renderInventorySlotRow(item); })}
); } }