Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
586 changes: 32 additions & 554 deletions .eslint-baseline.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/components/auth/ForgotPasswordForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom';
import { z } from 'zod';
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { Mail, Loader2, ArrowLeft, Clock, ShieldCheck } from 'lucide-react';
import { Mail, Loader2, ArrowLeft, Clock } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
Expand Down Expand Up @@ -56,7 +56,7 @@ export function ForgotPasswordForm({ onBack }: ForgotPasswordFormProps) {

// Navega para a página de confirmação com instruções detalhadas
navigate('/forgot-password-confirmation');
} catch (error) {
} catch (_error) {
toast({
variant: 'destructive',
title: 'Erro inesperado',
Expand Down
2 changes: 1 addition & 1 deletion src/components/auth/PasswordStrengthIndicator.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMemo, useEffect, useState, useCallback } from 'react';
import { useMemo, useEffect, useState } from 'react';
import { cn } from '@/lib/utils';
import { Check, X, AlertTriangle, Loader2, Shield } from 'lucide-react';
import { usePasswordBreachCheck } from '@/hooks/auth';
Expand Down
2 changes: 1 addition & 1 deletion src/components/bi/BIAiCopilot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export function BIAiCopilot({ open, onOpenChange, clientId, clientName, ramoAtiv
if (error) throw error;
const answer = (data as { answer?: string })?.answer ?? "Não consegui processar agora.";
setMessages((prev) => [...prev, { role: "assistant", content: answer }]);
} catch (e) {
} catch (_e) {
toast.error("Erro ao consultar o copiloto. Tente novamente.");
setMessages((prev) => [
...prev,
Expand Down
1 change: 0 additions & 1 deletion src/components/bi/ClientComparator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/
import { Card, CardContent } from "@/components/ui/card";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Skeleton } from "@/components/ui/skeleton";
import { CheckCircle2, AlertTriangle, X, Trophy, Minus } from "lucide-react";
import { cn } from "@/lib/utils";
Expand Down
2 changes: 1 addition & 1 deletion src/components/bi/ExecutiveSummaryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { Copy, Loader2, FileText, Sparkles, Presentation } from "lucide-react";
import { Copy, Loader2, Sparkles, Presentation } from "lucide-react";
import { toast } from "sonner";
import { useClientHealthScore } from "@/hooks/bi/useClientHealthScore";
import { useClientBI } from "@/hooks/bi/useClientBI";
Expand Down
15 changes: 5 additions & 10 deletions src/components/catalog/CatalogContent.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { useRef, useCallback, useEffect, useState, useMemo, memo, type RefObject } from 'react';
import { memo, type RefObject } from 'react';
import type { ActiveColorFilter } from '@/utils/color-image-resolver';
import { useVirtualizer } from '@tanstack/react-virtual';
import { Loader2, ArrowUp, AlertCircle } from 'lucide-react';
import { useProductsContextSafe } from '@/contexts/ProductsContext';
import { Button } from '@/components/ui/button';
import { Skeleton } from '@/components/ui/skeleton';


Expand All @@ -14,7 +10,6 @@ import { ProductCardSkeleton } from '@/components/products/ProductCardSkeleton';
import { ProductListItemSkeleton } from '@/components/products/ProductListItemSkeleton';
import { ProductTableSkeleton } from '@/components/products/ProductTableSkeleton';
import { EmptyState } from '@/components/common/EmptyState';
import { SelectionCheckbox } from '@/components/common/SelectionCheckbox';
import { CatalogBulkModals } from './CatalogBulkModals';
import { useCatalogSelection } from './useCatalogSelection';
import { cn } from '@/lib/utils';
Expand Down Expand Up @@ -66,7 +61,7 @@ export const CatalogContent = memo(function CatalogContent({
isLoadingMore,
totalEstimate,
loadMoreRef,
itemsPerPage,
itemsPerPage: _itemsPerPage,
navigate,
handleViewProduct,
handleShareProduct,
Expand All @@ -76,13 +71,13 @@ export const CatalogContent = memo(function CatalogContent({
isInCompare,
onToggleCompare,
canAddToCompare,
onLoadMore,
onLoadMore: _onLoadMore,
onResetFilters,
selectionMode,
onSelectedCountChange,
activeColorFilter,
activeProductId,
setActiveProductId,
activeProductId: _activeProductId,
setActiveProductId: _setActiveProductId,
}: CatalogContentProps) {
const selection = useCatalogSelection(
paginatedProducts,
Expand Down
2 changes: 1 addition & 1 deletion src/components/categories/CategorySidebarPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useCallback, type MouseEvent } from 'react';
import { ChevronRight, ChevronDown, Folder, FolderOpen, X, ChevronLeft, Layers } from 'lucide-react';
import { ChevronRight, Folder, X, ChevronLeft, Layers } from 'lucide-react';
import { useCategoriesTree, type CategoryNode, type CategoryTreeItem } from '@/hooks/products';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
Expand Down
2 changes: 1 addition & 1 deletion src/components/compare/ComparisonHighlights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
import { useMemo } from "react";
import { cn } from "@/lib/utils";
import { TrendingUp, TrendingDown, Minus, Crown, AlertTriangle } from "lucide-react";
import { TrendingUp, Minus, Crown, AlertTriangle } from "lucide-react";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";

type HighlightType = "best" | "worst" | "neutral";
Expand Down
15 changes: 5 additions & 10 deletions src/components/dashboard/QuickActionsPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import { useEffect, useState, useMemo } from "react";
import { useMemo } from "react";
import { Skeleton } from "@/components/ui/skeleton";
import { useNavigate } from "react-router-dom";
import {
FilePlus,
Clock,
CheckCircle2,
XCircle,
TrendingUp,
FileText,
ArrowRight,
DollarSign,
Clock, TrendingUp,
FileText, DollarSign,
Target,
BarChart3,
BarChart3
} from "lucide-react";
import { Card, CardContent } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
import { useQuotes, Quote } from "@/hooks/quotes";
import { useQuotes } from "@/hooks/quotes";
import { useAuth } from "@/contexts/AuthContext";
import { startOfMonth, endOfMonth, parseISO, isWithinInterval } from "date-fns";

Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard/RecentKitsWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { useQuery } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';
import { Package, Pencil, Clock, ArrowRight } from 'lucide-react';
import { Package, Clock, ArrowRight } from 'lucide-react';
import { supabase } from '@/integrations/supabase/client';
import { useAuth } from '@/contexts/AuthContext';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
Expand Down
2 changes: 1 addition & 1 deletion src/components/expert/ExpertChatDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Original: 1418 lines → Now: ~80 lines (orchestrator only)
*/
import { Dialog, DialogContent } from "@/components/ui/dialog";
import { FlowFilterPanel, defaultFlowFilters } from "./FlowFilterPanel";
import { FlowFilterPanel } from "./FlowFilterPanel";
import { useExpertChat } from "./chat/useExpertChat";
import { ChatHeader } from "./chat/ChatHeader";
import { ChatHistoryPanel } from "./chat/ChatHistoryPanel";
Expand Down
2 changes: 1 addition & 1 deletion src/components/filters/ColorGroupFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
CollapsibleTrigger,
} from '@/components/ui/collapsible';
import { cn } from '@/lib/utils';
import { useColorSystem, ColorGroup, ColorNuance, isLightColor } from '@/hooks/products';
import { useColorSystem, isLightColor } from '@/hooks/products';

// =====================================================
// TIPOS
Expand Down
1 change: 0 additions & 1 deletion src/components/filters/CommemorativeDateFilter.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useActiveCommemorativeDates, type CommemorativeDate } from "@/hooks/intelligence";
import { cn } from "@/lib/utils";
import { Skeleton } from "@/components/ui/skeleton";
import { ScrollArea } from "@/components/ui/scroll-area";

interface CommemorativeDateFilterProps {
selectedDates: string[];
Expand Down
1 change: 0 additions & 1 deletion src/components/filters/ExternalCategoryFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ChevronDown, ChevronRight, Search, X, Layers, RefreshCw } from "lucide-
import { Checkbox } from "@/components/ui/checkbox";
import { Label } from "@/components/ui/label";
import { Input } from "@/components/ui/input";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Skeleton } from "@/components/ui/skeleton";
import { Badge } from "@/components/ui/badge";
import { cn } from "@/lib/utils";
Expand Down
1 change: 0 additions & 1 deletion src/components/filters/FilterPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
QuickOptionsFilter,
} from "./filter-panel/sections/SimpleFilters";
import { SizeFilter } from "./filter-panel/sections/SizeFilter";
import { GenderBadge } from "@/components/products/GenderBadge";

export function FilterPanel({
filters, onFilterChange, onReset, activeFiltersCount,
Expand Down
3 changes: 1 addition & 2 deletions src/components/filters/filter-panel/sections/SizeFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
* Extrai size_codes únicos das variações dos produtos carregados.
*/
import { useMemo, useState } from "react";
import { Ruler, Search, X } from "lucide-react";
import { Search, X } from "lucide-react";
import { cn } from "@/lib/utils";
import { Input } from "@/components/ui/input";
import { Badge } from "@/components/ui/badge";

const SIZE_ORDER = [
"PP", "P", "M", "G", "GG", "XG", "XXG", "EG", "EGG",
Expand Down
2 changes: 1 addition & 1 deletion src/components/intelligence/IntelligenceFilterBar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useMemo, useCallback } from "react";
import { useState, useMemo } from "react";
import { Filter, X, ChevronDown, Package, Search } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
Expand Down
4 changes: 2 additions & 2 deletions src/components/intelligence/RankingFilterToolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useMemo, useCallback } from "react";
import { Search, Filter, ChevronDown, X, Tag, Hash, History, Clock } from "lucide-react";
import { useState, useMemo } from "react";
import { Search, Filter, ChevronDown, X, Tag, History, Clock } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
Expand Down
1 change: 0 additions & 1 deletion src/components/intelligence/SegmentAnalysis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { PieChart, Building2 } from "lucide-react";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Skeleton } from "@/components/ui/skeleton";
import { useSegmentAnalysis } from "@/hooks/intelligence";
import { cn } from "@/lib/utils";

export function SegmentAnalysis({ days = 30, categoryId, supplierId }: { days?: number; categoryId?: string | null; supplierId?: string | null }) {
const { data: segments, isLoading } = useSegmentAnalysis(days, categoryId, supplierId);
Expand Down
2 changes: 1 addition & 1 deletion src/components/inventory/StockAlertDialogs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from "react";
import { AlertTriangle, TrendingDown, X, CheckCircle2, Package, XCircle, Truck } from "lucide-react";
import { AlertTriangle, TrendingDown, X, CheckCircle2, XCircle } from "lucide-react";
import {
Dialog,
DialogContent,
Expand Down
1 change: 0 additions & 1 deletion src/components/inventory/StockCategoryTreeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { useState, useMemo } from "react";
import { ChevronRight, FolderTree, Search, X } from "lucide-react";
import { Input } from "@/components/ui/input";
import { ScrollArea } from "@/components/ui/scroll-area";
import { cn } from "@/lib/utils";
import { useCategoriesTree, type CategoryNode } from "@/hooks/products";
import { motion } from "framer-motion";
Expand Down
2 changes: 1 addition & 1 deletion src/components/inventory/StockDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function StockDashboard() {
return Math.round((healthy / summary.totalProducts) * 100);
}, [summary]);

const healthColor = healthScore >= 80 ? 'text-success' : healthScore >= 50 ? 'text-warning' : 'text-destructive';
const _healthColor = healthScore >= 80 ? 'text-success' : healthScore >= 50 ? 'text-warning' : 'text-destructive';

// Future stock total
const futureStockTotal = useMemo(
Expand Down
2 changes: 1 addition & 1 deletion src/components/inventory/StockFilterToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ interface StockFilterToolbarProps {
filteredCount: number;
}

const STATUS_OPTIONS: { value: StockStatus | 'all'; label: string; icon: React.ReactNode; color: string }[] = [
const _STATUS_OPTIONS: { value: StockStatus | 'all'; label: string; icon: React.ReactNode; color: string }[] = [
{ value: 'all', label: 'Todos', icon: <PackageCheck className="h-3.5 w-3.5" />, color: 'text-foreground' },
{ value: 'in_stock', label: 'Em Estoque', icon: <PackageCheck className="h-3.5 w-3.5" />, color: 'text-success' },
{ value: 'low_stock', label: 'Baixo', icon: <AlertTriangle className="h-3.5 w-3.5" />, color: 'text-warning' },
Expand Down
2 changes: 1 addition & 1 deletion src/components/kit-builder/BoxSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ScrollArea } from '@/components/ui/scroll-area';
import { Slider } from '@/components/ui/slider';
import { Label } from '@/components/ui/label';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
import { Collapsible, CollapsibleContent } from '@/components/ui/collapsible';
import { cn } from '@/lib/utils';
import {
formatVolume,
Expand Down
3 changes: 1 addition & 2 deletions src/components/kit-builder/DiscontinuedItemsAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
* Checks if any items in a kit are marked inactive and alerts the user
*/

import { AlertTriangle, ExternalLink } from 'lucide-react';
import { AlertTriangle } from 'lucide-react';
import { Card, CardContent } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
import type { KitItem } from '@/lib/kit-builder';
import { useQuery } from '@tanstack/react-query';
import { supabase } from '@/integrations/supabase/client';
Expand Down
2 changes: 1 addition & 1 deletion src/components/kit-builder/KitIsometricPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export function KitIsometricPreview({ kitState, className }: KitIsometricPreview

{/* Itens empilhados */}
{sorted.map((p) => {
const c000 = iso(p.x, p.y, 0);
const _c000 = iso(p.x, p.y, 0);
const c100 = iso(p.x + p.w, p.y, 0);
const c101 = iso(p.x + p.w, p.y, p.d);
const c001 = iso(p.x, p.y, p.d);
Expand Down
1 change: 0 additions & 1 deletion src/components/kit-builder/KitSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Sub-components extracted to ./kit-summary/
*/
import { Card, CardContent } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { AlertTriangle } from 'lucide-react';
import { KitMarginSimulator } from './KitMarginSimulator';
import { KitVisualPreview } from './KitVisualPreview';
Expand Down
1 change: 0 additions & 1 deletion src/components/kit-builder/SimilarKitsWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useNavigate } from 'react-router-dom';
import * as Lucide from 'lucide-react';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
import { Skeleton } from '@/components/ui/skeleton';
import { useSimilarKits } from '@/hooks/kit-builder';
import { formatCurrency } from '@/lib/kit-builder';
Expand Down
6 changes: 2 additions & 4 deletions src/components/layout/GlobalOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Suspense, lazy } from "react";
import { Suspense } from "react";
import { lazyWithRetry } from "@/lib/lazyWithRetry";
import { Toaster } from "@/components/ui/toaster";
import { Toaster as Sonner } from "@/components/ui/sonner";

// Lazy-loaded global components
const OnboardingTour = lazyWithRetry(() => import("@/components/onboarding/OnboardingTour").then(m => ({ default: m.OnboardingTour })));
const ExpertChatButton = lazyWithRetry(() => import("@/components/expert/ExpertChatButton").then(m => ({ default: m.ExpertChatButton })));
const _ExpertChatButton = lazyWithRetry(() => import("@/components/expert/ExpertChatButton").then(m => ({ default: m.ExpertChatButton })));
const EnhancedSpotlight = lazyWithRetry(() => import("@/components/common/EnhancedSpotlight").then(m => ({ default: m.EnhancedSpotlight })));
const SmartMobileNav = lazyWithRetry(() => import("@/components/mobile/SmartMobileNav").then(m => ({ default: m.SmartMobileNav })));
const QuickQuoteFAB = lazyWithRetry(() => import("@/components/quotes/QuickQuoteFAB").then(m => ({ default: m.QuickQuoteFAB })));
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/SidebarReorganized.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const SidebarReorganized = React.memo(
isCollapsed ? "4rem" : "16rem",
);
}, [isCollapsed]);
const isItemActive = (href: string, exact?: boolean) =>
const _isItemActive = (href: string, exact?: boolean) =>
isNavItemActive(location.pathname, href, exact);

// Compute which groups should be auto-opened for the current route.
Expand Down
2 changes: 1 addition & 1 deletion src/components/mobile/MobileProductActions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import { Heart, Share2, Calculator, FileText, ShoppingCart } from "lucide-react";
import { Heart, Share2, FileText } from "lucide-react";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { useNavigate } from "react-router-dom";
Expand Down
27 changes: 9 additions & 18 deletions src/components/mobile/SmartMobileNav.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
import React, { useState, useEffect, forwardRef } from "react";
import { useState, useEffect, forwardRef } from "react";
import { NavLink, useLocation, useNavigate } from "react-router-dom";
import { getPrefetchHandlers } from "@/lib/routePrefetch";
import {
Home,
Package,
FileText,
import {
Home,
Package,
FileText,

Plus,
Heart,
Wand2,
BarChart3,
ShoppingCart,
Settings,
Sparkles,
Calculator,
Wand2, ShoppingCart, Calculator,
FolderOpen,
X,
Sun,
Moon,
X
} from "lucide-react";
import { useTheme } from "@/contexts/ThemeContext";
import { cn } from "@/lib/utils";
import { motion, AnimatePresence } from "framer-motion";
import { VisuallyHidden } from "@/components/a11y/VisuallyHidden";

interface NavItem {
icon: typeof Home;
Expand Down Expand Up @@ -172,7 +163,7 @@ export const SmartMobileNav = forwardRef<HTMLDivElement>(function SmartMobileNav
style={{ paddingBottom: 'env(safe-area-inset-bottom, 0.5rem)' }}
>
<div className="flex items-center justify-around h-14 sm:h-16 px-1 sm:px-2 relative">
{mainNavItems.map((item, index) => {
{mainNavItems.map((item, _index) => {
const Icon = item.icon;
const active = isActive(item.href);
const isFab = item.href === "#fab";
Expand Down
2 changes: 1 addition & 1 deletion src/components/mockup/LogoColorAnalyzer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover
import { Input } from '@/components/ui/input';
import { ScrollArea } from '@/components/ui/scroll-area';
import { cn } from '@/lib/utils';
import { searchPantone, type PantoneColor } from '@/data/pantone-coated';
import { searchPantone } from '@/data/pantone-coated';
import type { DetectedColor } from '@/hooks/simulation';

interface LogoColorAnalyzerProps {
Expand Down
Loading
Loading