import React from 'react'; import * as ApiUtils from '../CloudApi/ApiUtils.js'; import { Label, Message, Icon } from 'semantic-ui-react' export default class InventoryItemPickingHint extends React.Component { render() { if (!this.props.pickingHint) { return null; } let alertLabel = null; let color = "red"; if (this.props.pickingHint.type === "BeyondCushionV1") { color = "black"; } else if (this.props.pickingHint.type === "BigscreenBeyondV1") { color = "brown"; } else if (this.props.pickingHint.type === "ReplacementBigscreenBeyondV1") { color = "purple"; alertLabel = ; } else if (this.props.pickingHint.type === "PrescriptionLensInserts") { color = "teal"; } else { color = "blue"; } let trackingType = this.props.pickingHint.inventoryItem ? (this.props.pickingHint.inventoryItem.trackingType || "Untracked") : "Untracked"; if (trackingType === "QuantityTracked") { alertLabel = ; color = "purple"; } if (this.props.pickingHint.binIdentifier) { return ( {this.props.pickingHint.binIdentifier} Bin: {parseInt(this.props.pickingHint.binIdentifier, 10)} IPD: {this.props.pickingHint.ipd} Shopify Id: {this.props.pickingHint.shopifyOrderId} ); } else if (trackingType === "Untracked") { return ( Inventory not tracked Stock availability unknown. ); } else if (trackingType === "QuantityTracked") { return ( {alertLabel} Serial Number: {this.props.pickingHint.inventoryItem.serialNumber} Quantity Remaining: {this.props.pickingHint.inventoryItem.quantity} ); } else { return ( {alertLabel} {this.props.pickingHint.ipd && IPD: {this.props.pickingHint.ipd}} Serial Number: {this.props.pickingHint.serialNumber} ); } } }