mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-14 10:48:09 +02:00
feat: implement AI copilot scoring engine for product analysis and recommendations, including a verification script for recent product logic.
This commit is contained in:
1 parent
56b09a438d
commit
a008b40a59
4 files changed
+71
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import React, { useState, useRef } from "react";
|
||||
import React, { useState, useRef, useEffect } from "react";
|
||||
import { useGridStore } from "@/features/grid/store/use-grid-store";
|
||||
import { useAiCopilotStore } from "@/features/ai-copilot/store/use-ai-copilot-store";
|
||||
import { ScoringEngine } from "@/features/ai-copilot/business/scoring-engine";
|
||||
@@ -23,6 +23,16 @@ export function BulkAiAnalyzer() {
|
||||
const setDraftGamme = useGridStore((s) => s.setDraftGamme);
|
||||
const { setInsight, batchSetLoading, setError } = useAiCopilotStore();
|
||||
|
||||
const prevSupplierRef = useRef(supplierCode);
|
||||
useEffect(() => {
|
||||
if (supplierCode !== prevSupplierRef.current) {
|
||||
if (!isAnalyzing) {
|
||||
setProgress({ current: 0, total: 0, message: "", errors: 0 });
|
||||
}
|
||||
prevSupplierRef.current = supplierCode;
|
||||
}
|
||||
}, [supplierCode, isAnalyzing]);
|
||||
|
||||
const handleStop = () => {
|
||||
isCancelledRef.current = true;
|
||||
setProgress((prev) => ({ ...prev, message: "Arrêt en cours..." }));
|
||||
|
||||
Reference in new issue
Block a user