feat: Add bulk AI product analysis component with progress tracking, concurrency, and benchmark calculations, along with a component for displaying individual AI insights.

This commit is contained in:
Michael committed 2026-02-22 23:58:19 +01:00
1 parent 960045dc53
commit 673cab4454
2 files changed
+9

No files matched your search

@@ -5,17 +5,24 @@ import { useAiCopilotStore } from "@/features/ai-copilot/store/use-ai-copilot-st
import type { ProductRow } from "@/types/grid";
import { cn } from "@/lib/utils";
import { useGridStore } from "@/features/grid/store/use-grid-store";
interface AiInsightBlockProps {
row: ProductRow;
}
export function AiInsightBlock({ row }: AiInsightBlockProps) {
const { insights, analyzeProduct } = useAiCopilotStore();
const setDraftGamme = useGridStore(state => state.setDraftGamme);
const insight = insights[row.codein];
const status = insight?.status ?? "idle";
const handleAnalyze = () => {
if (status === "loading") return;
// Vider la recommandation actuelle avant de relancer l'IA
setDraftGamme(row.codein, "Aucune");
analyzeProduct({
codein: row.codein,
libelle1: row.libelle1,