From 447eadd88ca4c88cc264ed8e81d630a85757cbb4 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 11 Oct 2025 15:33:49 +0000 Subject: [PATCH] Refactor sidebar and menu items --- src/App.tsx | 15 ---- src/components/DashboardLayout.tsx | 7 +- src/components/admin/ConfigTab.tsx | 130 +++++++++++++++++++++++++++-- 3 files changed, 128 insertions(+), 24 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 25795f2..f24b4dd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -273,14 +273,6 @@ const AppRouter = () => ( } /> - - - - - - } /> - @@ -514,13 +506,6 @@ const AppRouter = () => ( } /> - - - - - - } /> {/* Catch-all route */} } /> diff --git a/src/components/DashboardLayout.tsx b/src/components/DashboardLayout.tsx index aa12942..497aea0 100644 --- a/src/components/DashboardLayout.tsx +++ b/src/components/DashboardLayout.tsx @@ -115,7 +115,10 @@ const DashboardLayout = ({ children }: { children: React.ReactNode }) => { }, { icon: AlertTriangle, label: 'Emergencias', path: '/dashboard/admin?tab=emergency' }, { icon: MessageSquare, label: 'Soporte', path: '/dashboard/admin?tab=support' }, - { icon: Settings, label: 'Configuración', path: '/dashboard/admin?tab=config' } + { icon: Settings, label: 'Configuración', path: '/dashboard/admin?tab=config' }, + { icon: BarChart3, label: 'Analytics', path: '/dashboard/analytics' }, + { icon: Search, label: 'Buscar Lugares', path: '/dashboard/search-places' }, + { icon: Store, label: 'Buscar Comercios', path: '/dashboard/search-establishments' } ] }, { @@ -157,8 +160,6 @@ const DashboardLayout = ({ children }: { children: React.ReactNode }) => { { icon: Users, label: t('staff'), path: '/dashboard/restaurant/staff' } ] }, - { icon: Brain, label: 'Personalization', path: '/dashboard/personalization' }, - { icon: Shield, label: 'Security', path: '/dashboard/security' }, { icon: Car, label: 'Vehicle Management', path: '/dashboard/vehicle-management' }, { icon: Leaf, label: 'Sustainability', path: '/dashboard/sustainability' }, { diff --git a/src/components/admin/ConfigTab.tsx b/src/components/admin/ConfigTab.tsx index b04a6c8..98eb0d4 100644 --- a/src/components/admin/ConfigTab.tsx +++ b/src/components/admin/ConfigTab.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Settings, Cog, Database, Wifi, Shield, Server, Key, Users, Activity, RefreshCw, TestTube, Edit, Save, X, CreditCard, Eye, EyeOff } from 'lucide-react'; +import { Settings, Cog, Database, Wifi, Shield, Server, Key, Users, Activity, RefreshCw, TestTube, Edit, Save, X, CreditCard, Eye, EyeOff, Brain } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Switch } from '@/components/ui/switch'; @@ -7,6 +7,14 @@ import { Badge } from '@/components/ui/badge'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { useSystemConfig } from '@/hooks/useSystemConfig'; +import ThreatDetection from '@/components/security/ThreatDetection'; +import AccessControl from '@/components/security/AccessControl'; +import AuditLogs from '@/components/security/AuditLogs'; +import ComplianceMonitor from '@/components/security/ComplianceMonitor'; +import AIRecommendations from '@/components/personalization/AIRecommendations'; +import UserPreferences from '@/components/personalization/UserPreferences'; +import BehaviorAnalytics from '@/components/personalization/BehaviorAnalytics'; +import SegmentManagement from '@/components/personalization/SegmentManagement'; interface ConfigTabProps { isAdmin: boolean; @@ -85,7 +93,7 @@ const ConfigTab: React.FC = ({ isSuperAdmin }) => {

Configuración del Sistema

- + APIs @@ -102,14 +110,22 @@ const ConfigTab: React.FC = ({ isSuperAdmin }) => { Integraciones - + - Seguridad + Seguridad Sistema Auditoría + + + Security Center + + + + Personalización + @@ -548,12 +564,12 @@ const ConfigTab: React.FC = ({ isSuperAdmin }) => { - + - Configuración de Seguridad + Configuración de Seguridad del Sistema @@ -632,6 +648,108 @@ const ConfigTab: React.FC = ({ isSuperAdmin }) => { + + +
+
+ +
+

Security Center

+

Monitor y gestión de seguridad del sistema

+
+
+ + + + Threat Detection + Access Control + Audit Logs + Compliance + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ +
+

Personalización con IA

+

Gestión de recomendaciones y segmentación de usuarios

+
+
+ + + + Recomendaciones + Preferencias + Analytics + Segmentos + + + + + + Recomendaciones IA + + + + + + + + + + + Preferencias de Usuario + + + + + + + + + + + Analytics de Comportamiento + + + + + + + + + + + Gestión de Segmentos + + + + + + + +
+
);