import React from 'react';
import superagent from 'superagent';
import { Table, Statistic, Button, Header, Segment, Icon, Flag, Grid } from 'semantic-ui-react'
import * as ApiUtils from '../CloudApi/ApiUtils.js';
import BigOrdersWrapper from './BigOrdersWrapper.jsx';
import BigOrdersQuery from './BigOrdersQuery.jsx';
class BigOrderCompactReport extends React.Component {
render() {
const ipd = this.props.data["ipd"];
const count = this.props.data["Count"];
return (
0} negative={count == 0}>
{ipd}
{count}
View Orders...
)
}
}
export default class BigOrderReport extends React.Component {
constructor(props) {
super(props);
this.state = {
bigOrder: null
};
}
async componentDidMount() {
try {
let schemas = await ApiUtils.getFabricatorSchemas();
this.setState({ schemas });
} catch (e) {
console.log(e);
}
const res = await superagent.get(`/api/admin/shop/orders/report2?groupBy=ipd&orderBy=ipd&origin=Shopify&state=WaitingForInventory`);
console.log(res.body);
this.setState({ items: res.body.items, count: res.body.count });
}
async onUpdateQuery(params) {
this.setState({ loading: true, count: undefined });
try {
const res = await superagent.get(`/api/admin/shop/orders/report2?${params.toString()}&groupBy=ipd&orderBy=ipd`);
this.setState({ items: res.body.items, count: res.body.count });
} catch (e) {
this.setState({ error: e });
}
this.setState({ loading: false });
}
render() {
if (!this.state.schemas) return null;
return (
{this.state.items &&
IPD
Count
View
{this.state.items.map(data => {
return
})}
}
);
}
}