mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-11 17:26:32 +02:00
chore(cleanup): remove unused imports, variables and fix missing hook dependencies
This commit is contained in:
1 parent
c1bd0ae097
commit
86240f4b46
6 files changed
+11
-17
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import { getFournisseurs, getGridData, getMagasins } from "@/features/grid/actions";
|
||||
import { GridClient } from "@/features/grid/components/grid-client";
|
||||
import { SupplierSelectionLanding } from "@/features/grid/components/supplier-selection-landing";
|
||||
import { Suspense } from "react";
|
||||
|
||||
interface GridPageProps {
|
||||
searchParams: Promise<{ fournisseur?: string; magasin?: string }>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useCallback } from "react";
|
||||
import { Save, Eye, EyeOff, CheckCircle, AlertCircle, Loader2, RefreshCw, Sun, Moon, BarChart3, RotateCcw } from "lucide-react";
|
||||
import { Save, Eye, EyeOff, CheckCircle, AlertCircle, Loader2, RefreshCw, Sun, Moon, RotateCcw } from "lucide-react";
|
||||
import { useTheme } from "next-themes";
|
||||
import { useGridStore } from "@/features/grid/store/use-grid-store";
|
||||
import { useScoreSettingsStore } from "@/features/score/store/use-score-settings-store";
|
||||
@@ -71,11 +71,6 @@ export default function SettingsPage() {
|
||||
getDatabaseUrl
|
||||
} = useDbSettingsStore();
|
||||
|
||||
useEffect(() => {
|
||||
setIsMounted(true);
|
||||
reloadFromServer();
|
||||
}, []);
|
||||
|
||||
const fetchModels = useCallback(async (key: string) => {
|
||||
if (!key.trim()) return;
|
||||
setModelsStatus("loading");
|
||||
@@ -90,7 +85,7 @@ export default function SettingsPage() {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const reloadFromServer = async () => {
|
||||
const reloadFromServer = useCallback(async () => {
|
||||
const config = await getSavedDatabaseConfig();
|
||||
if (config) {
|
||||
if (config.url) {
|
||||
@@ -115,7 +110,12 @@ export default function SettingsPage() {
|
||||
setSelectedModel(config.openRouterModel);
|
||||
}
|
||||
}
|
||||
};
|
||||
}, [fetchModels, setApiKey, setDatabase, setHost, setPassword, setPort, setSelectedModel, setSsl, setUser]);
|
||||
|
||||
useEffect(() => {
|
||||
setIsMounted(true);
|
||||
reloadFromServer();
|
||||
}, [reloadFromServer]);
|
||||
|
||||
const testDb = async () => {
|
||||
setDbStatus("testing");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { db } from "@/db";
|
||||
import { ventesProduits } from "@/db/schema";
|
||||
import { eq, and, ne, sql } from "drizzle-orm";
|
||||
import { eq, and, ne } from "drizzle-orm";
|
||||
import type { ProductRow, GammeCode } from "@/types/grid";
|
||||
import { computeProductScores } from "@/lib/score-engine";
|
||||
|
||||
|
||||
@@ -6,11 +6,6 @@ interface FinancialCellProps {
|
||||
tauxMarge: number;
|
||||
}
|
||||
|
||||
function getMarginColor(pct: number): string {
|
||||
if (pct >= 45) return "#10b981"; // emerald-500
|
||||
if (pct >= 20) return "#f59e0b"; // amber-500
|
||||
return "#f43f5e"; // rose-500
|
||||
}
|
||||
|
||||
export function FinancialCell({ totalCa, totalMarge, tauxMarge }: FinancialCellProps) {
|
||||
const isHighMargin = tauxMarge >= 45;
|
||||
|
||||
@@ -225,7 +225,7 @@ export function HeatmapGrid({ onSelectionChange }: HeatmapGridProps) {
|
||||
enableSorting: false,
|
||||
cell: ({ row }) => <AiInsightBlock row={row.original} />,
|
||||
},
|
||||
], [draftChanges, setDraftGamme]);
|
||||
], [draftChanges, setDraftGamme, MONTHS_12]);
|
||||
|
||||
const table = useReactTable({
|
||||
data: rows,
|
||||
|
||||
Reference in new issue
Block a user