diff --git a/client/src/components/bill-enter-ai-scan/bill-enter-ai-scan.component.jsx b/client/src/components/bill-enter-ai-scan/bill-enter-ai-scan.component.jsx index 38c7802e4..61c39f28b 100644 --- a/client/src/components/bill-enter-ai-scan/bill-enter-ai-scan.component.jsx +++ b/client/src/components/bill-enter-ai-scan/bill-enter-ai-scan.component.jsx @@ -5,6 +5,7 @@ import { createStructuredSelector } from "reselect"; import { useNotification } from "../../contexts/Notifications/notificationContext"; import { selectBillEnterModal } from "../../redux/modals/modals.selectors"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import { FaWandMagicSparkles } from "react-icons/fa6"; const mapStateToProps = createStructuredSelector({ billEnterModal: selectBillEnterModal, @@ -19,7 +20,8 @@ function BillEnterAiScan({ form, fileInputRef, scanLoading, - setScanLoading + setScanLoading, + setIsAiScan }) { const notification = useNotification(); @@ -59,8 +61,6 @@ function BillEnterAiScan({ } // If status is IN_PROGRESS, continue polling } catch (error) { - console.error("Error polling job status:", error); - // Stop polling on error if (pollingIntervalRef.current) { clearInterval(pollingIntervalRef.current); @@ -86,11 +86,12 @@ function BillEnterAiScan({ const file = e.target.files?.[0]; if (file) { setScanLoading(true); + setIsAiScan(true); const formdata = new FormData(); formdata.append("billScan", file); formdata.append("jobid", billEnterModal.context.job.id); formdata.append("bodyshopid", bodyshop.id); - formdata.append("partsorderid", "3dd26419-a139-4399-af4e-43eeb6f0dbad"); + formdata.append("partsorderid", billEnterModal.context.parts_order?.id); //formdata.append("skipTextract", "true"); // For testing purposes axios .post("/ai/bill-ocr", formdata) @@ -123,7 +124,6 @@ function BillEnterAiScan({ } }) .catch((error) => { - console.error("*** ~ BillEnterModalContainer ~ error:", error); setScanLoading(false); notification.error({ title: "AI Scan Failed", @@ -137,9 +137,9 @@ function BillEnterAiScan({ />