feature/IO-3103-Ant5-Notifications
This commit is contained in:
@@ -2,6 +2,7 @@ import { MailFilled, PrinterFilled } from "@ant-design/icons";
|
||||
import { Space, Spin } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||
|
||||
export default function PrintWrapperComponent({
|
||||
templateObject,
|
||||
@@ -12,10 +13,12 @@ export default function PrintWrapperComponent({
|
||||
disabled
|
||||
}) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const notification = useNotification();
|
||||
|
||||
const handlePrint = async (type) => {
|
||||
if (disabled) return;
|
||||
setLoading(true);
|
||||
await GenerateDocument(templateObject, messageObject, type, id);
|
||||
await GenerateDocument(templateObject, messageObject, type, id, notification);
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user