mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-15 03:08:31 +02:00
feat: Implement dashboard layout with new sidebar, bulk AI analysis, supplier AI context modal, and floating summary bar.
This commit is contained in:
1 parent
8ce98c73fc
commit
a092572829
5 files changed
+58
-90
No files matched your search
@@ -210,53 +210,48 @@ export function BulkAiAnalyzer() {
|
||||
setTimeout(() => setIsAnalyzing(false), 3000);
|
||||
};
|
||||
|
||||
if (isAnalyzing) {
|
||||
return (
|
||||
<div className="flex items-center gap-4 h-10 px-4 rounded-xl bg-[var(--accent-bg)] border border-[var(--accent-border)] shadow-sm">
|
||||
<Loader2 className="w-4 h-4 text-[var(--accent)] animate-spin" />
|
||||
<div className="flex flex-col min-w-[150px]">
|
||||
<span className="text-[10px] font-bold text-[var(--accent)] leading-none">
|
||||
{progress.message}
|
||||
</span>
|
||||
<div className="w-full bg-[var(--bg-elevated)] rounded-full h-1 mt-1 overflow-hidden">
|
||||
<div
|
||||
className="bg-[var(--accent)] h-1 rounded-full transition-all duration-300"
|
||||
style={{ width: `${Math.max(5, (progress.current / progress.total) * 100)}%` }}
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
onClick={handleStop}
|
||||
className="p-1 hover:bg-[var(--bg-elevated)] rounded-lg transition-colors text-[var(--text-muted)] hover:text-[var(--accent-error)]"
|
||||
title="Arrêter l'analyse"
|
||||
>
|
||||
<XCircle className="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (progress.current > 0 && !isAnalyzing) {
|
||||
return (
|
||||
<div className="flex items-center gap-2 h-10 px-4 rounded-xl bg-[var(--accent-success-bg)] border border-[var(--accent-success)] shadow-sm cursor-default">
|
||||
<CheckCircle2 className="w-4 h-4 text-[var(--accent-success)]" />
|
||||
<span className="text-xs font-bold text-[var(--accent-success)]">
|
||||
{progress.errors > 0 ? `Terminé (${progress.current - progress.errors}/${progress.total})` : `Analyse Terminée`}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-3">
|
||||
<SupplierAiContextModal codeFournisseur={supplierCode} nomFournisseur={supplierName} />
|
||||
<button
|
||||
onClick={handleAnalyze}
|
||||
className="group flex items-center justify-center gap-2 h-10 px-6 rounded-xl text-sm font-black transition-all shadow-md bg-[var(--accent)] text-white hover:brightness-110 active:scale-95 border border-white/10"
|
||||
>
|
||||
<Sparkles className="w-4 h-4" />
|
||||
Analyse IA
|
||||
</button>
|
||||
|
||||
{isAnalyzing ? (
|
||||
<div className="flex items-center gap-4 h-10 px-4 rounded-xl bg-[var(--accent-bg)] border border-[var(--accent-border)] shadow-sm">
|
||||
<Loader2 className="w-4 h-4 text-[var(--accent)] animate-spin" />
|
||||
<div className="flex flex-col min-w-[150px]">
|
||||
<span className="text-[10px] font-bold text-[var(--accent)] leading-none">
|
||||
{progress.message}
|
||||
</span>
|
||||
<div className="w-full bg-[var(--bg-elevated)] rounded-full h-1 mt-1 overflow-hidden">
|
||||
<div
|
||||
className="bg-[var(--accent)] h-1 rounded-full transition-all duration-300"
|
||||
style={{ width: `${Math.max(5, (progress.current / progress.total) * 100)}%` }}
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
onClick={handleStop}
|
||||
className="p-1 hover:bg-[var(--bg-elevated)] rounded-lg transition-colors text-[var(--text-muted)] hover:text-[var(--accent-error)]"
|
||||
title="Arrêter l'analyse"
|
||||
>
|
||||
<XCircle className="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
) : progress.current > 0 ? (
|
||||
<div className="flex items-center gap-2 h-10 px-4 rounded-xl bg-[var(--accent-success-bg)] border border-[var(--accent-success)] shadow-sm cursor-default">
|
||||
<CheckCircle2 className="w-4 h-4 text-[var(--accent-success)]" />
|
||||
<span className="text-xs font-bold text-[var(--accent-success)]">
|
||||
{progress.errors > 0 ? `Terminé (${progress.current - progress.errors}/${progress.total})` : `Analyse Terminée`}
|
||||
</span>
|
||||
</div>
|
||||
) : (
|
||||
<button
|
||||
onClick={handleAnalyze}
|
||||
className="group flex items-center justify-center gap-2 h-10 px-6 rounded-xl text-sm font-black transition-all shadow-md bg-[var(--accent)] text-white hover:brightness-110 active:scale-95 border border-white/10"
|
||||
>
|
||||
<Sparkles className="w-4 h-4" />
|
||||
Analyse IA
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -133,8 +133,8 @@ export function FloatingSummaryBar() {
|
||||
</button>
|
||||
<div className="w-[1px] h-4 bg-slate-200 dark:bg-slate-800 mx-1.5" />
|
||||
{hasDrafts && (
|
||||
<span className="text-[10px] font-black uppercase text-amber-600 dark:text-amber-500 bg-amber-100 dark:bg-amber-900/30 px-2 py-0.5 rounded border border-amber-200 dark:border-amber-800">
|
||||
{count} modif.
|
||||
<span className="text-[12px] font-black tracking-tight text-[#b45309] bg-[#fef08a] px-3 py-1 rounded-md border border-[#fde047] ml-2">
|
||||
{count} MODIF.
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -94,7 +94,7 @@ export function SupplierAiContextModal({ codeFournisseur, nomFournisseur }: Supp
|
||||
<Button variant="outline" onClick={() => setOpen(false)} disabled={isSaving}>
|
||||
Annuler
|
||||
</Button>
|
||||
<Button onClick={handleSave} disabled={isSaving || isLoading} className="gap-2 bg-gradient-to-r from-violet-600 to-indigo-600 text-white hover:from-violet-700 hover:to-indigo-700">
|
||||
<Button onClick={handleSave} disabled={isSaving || isLoading} className="gap-2 bg-emerald-600 hover:bg-emerald-700 text-white">
|
||||
{isSaving ? "Enregistrement..." : "Enregistrer les règles"}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
|
||||
Reference in new issue
Block a user