Resolved bulk printing & status for printing items. IO-690

This commit is contained in:
Patrick Fic
2021-02-23 10:34:31 -08:00
parent fad4ee4ef5
commit 666931aacd
6 changed files with 197 additions and 120 deletions

View File

@@ -1,5 +1,6 @@
import { MailOutlined, PrinterOutlined } from "@ant-design/icons";
import React from "react";
import { Spin } from "antd";
import React, { useState } from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { setEmailOptions } from "../../redux/email/email.actions";
@@ -22,8 +23,10 @@ export function PrintCenterItemComponent({
bodyshop,
disabled,
}) {
const [loading, setLoading] = useState(false);
const { context } = printCenterModal;
const renderToNewWindow = async () => {
setLoading(true);
await GenerateDocument(
{
name: item.key,
@@ -32,6 +35,7 @@ export function PrintCenterItemComponent({
{},
"p"
);
setLoading(false);
};
if (disabled) return <li className="print-center-item">{item.title} </li>;
@@ -51,6 +55,7 @@ export function PrintCenterItemComponent({
);
}}
/>
{loading && <Spin size="small" />}
</li>
);
}