import React from 'react'; import {formatPrice} from '../Util/formatters'; import DraggableTableRow from '../Util/DraggableTableRow.jsx'; import { Container, Segment, Grid, Header, Image, Icon, Button, Table, Form, Label, Message, Menu, Tab, Dropdown, Modal, Card, Divider} from 'semantic-ui-react' export default class MediaCollection extends React.Component { constructor(props) { super(props); this.state = { collection: null, a: null }; } async onRemove(productIndex, e) { e.preventDefault(); this.props.onRemoveProduct(productIndex); } render() { if (!(this.props.collection && this.props.collection.products && this.props.collection.products.length > 0)) { return
; } let onReorder = async function(productIndexA, productIndexB) { if (productIndexA >= this.props.collection.products.length || productIndexA < 0) { return; } this.props.onReorderProduct(productIndexA, productIndexB); } return ( Title Status Store Link BigMediaId Duration Synchronization Interval Entitlement Class Location Codes SKUs Tools {this.props.collection.products.map((product, productIndex) => { const locationCodes = product.locationCodes ? (
{product.locationCodes.map(locationCode => ( ))}
) :
; const prices = (
{product.stripeProductData && product.stripeProductData.skus && product.stripeProductData.skus.data.map(sku => ( ))}
); const isRemovable = !this.props.collection.isScheduled || this.props.collection.isPublished === false; return (
{product.title}
Store {product.bigMediaId} {locationCodes} {prices} {isRemovable && }
); })}
); } }