Refactor sidebar and menu items
This commit is contained in:
@@ -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' },
|
||||
{
|
||||
|
||||
@@ -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<ConfigTabProps> = ({ isSuperAdmin }) => {
|
||||
<h2 className="text-xl font-semibold text-gray-900">Configuración del Sistema</h2>
|
||||
|
||||
<Tabs defaultValue="apis" className="w-full">
|
||||
<TabsList className="grid w-full grid-cols-6">
|
||||
<TabsList className="grid w-full grid-cols-8 lg:grid-cols-8">
|
||||
<TabsTrigger value="apis" className="flex items-center gap-2">
|
||||
<Server className="w-4 h-4" />
|
||||
APIs
|
||||
@@ -102,14 +110,22 @@ const ConfigTab: React.FC<ConfigTabProps> = ({ isSuperAdmin }) => {
|
||||
<Wifi className="w-4 h-4" />
|
||||
Integraciones
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="security" className="flex items-center gap-2">
|
||||
<TabsTrigger value="system-security" className="flex items-center gap-2">
|
||||
<Shield className="w-4 h-4" />
|
||||
Seguridad
|
||||
Seguridad Sistema
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="audit" className="flex items-center gap-2">
|
||||
<Activity className="w-4 h-4" />
|
||||
Auditoría
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="security" className="flex items-center gap-2">
|
||||
<Shield className="w-4 h-4" />
|
||||
Security Center
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="personalization" className="flex items-center gap-2">
|
||||
<Brain className="w-4 h-4" />
|
||||
Personalización
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="apis" className="space-y-4">
|
||||
@@ -548,12 +564,12 @@ const ConfigTab: React.FC<ConfigTabProps> = ({ isSuperAdmin }) => {
|
||||
</Card>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="security" className="space-y-4">
|
||||
<TabsContent value="system-security" className="space-y-4">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Shield className="w-5 h-5" />
|
||||
Configuración de Seguridad
|
||||
Configuración de Seguridad del Sistema
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
@@ -632,6 +648,108 @@ const ConfigTab: React.FC<ConfigTabProps> = ({ isSuperAdmin }) => {
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="security" className="space-y-6">
|
||||
<div className="space-y-6">
|
||||
<div className="flex items-center gap-3">
|
||||
<Shield className="w-8 h-8 text-orange-600" />
|
||||
<div>
|
||||
<h3 className="text-2xl font-bold text-gray-900">Security Center</h3>
|
||||
<p className="text-gray-600">Monitor y gestión de seguridad del sistema</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Tabs defaultValue="threats" className="space-y-6">
|
||||
<TabsList className="grid w-full grid-cols-4 lg:w-auto">
|
||||
<TabsTrigger value="threats">Threat Detection</TabsTrigger>
|
||||
<TabsTrigger value="access">Access Control</TabsTrigger>
|
||||
<TabsTrigger value="audit-logs">Audit Logs</TabsTrigger>
|
||||
<TabsTrigger value="compliance">Compliance</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="threats">
|
||||
<ThreatDetection />
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="access">
|
||||
<AccessControl />
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="audit-logs">
|
||||
<AuditLogs />
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="compliance">
|
||||
<ComplianceMonitor />
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="personalization" className="space-y-6">
|
||||
<div className="space-y-6">
|
||||
<div className="flex items-center gap-3">
|
||||
<Brain className="w-8 h-8 text-orange-600" />
|
||||
<div>
|
||||
<h3 className="text-2xl font-bold text-gray-900">Personalización con IA</h3>
|
||||
<p className="text-gray-600">Gestión de recomendaciones y segmentación de usuarios</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Tabs defaultValue="recommendations" className="space-y-6">
|
||||
<TabsList className="grid w-full grid-cols-4 lg:w-auto">
|
||||
<TabsTrigger value="recommendations">Recomendaciones</TabsTrigger>
|
||||
<TabsTrigger value="preferences">Preferencias</TabsTrigger>
|
||||
<TabsTrigger value="analytics-behavior">Analytics</TabsTrigger>
|
||||
<TabsTrigger value="segments">Segmentos</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="recommendations">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Recomendaciones IA</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<AIRecommendations />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="preferences">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Preferencias de Usuario</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<UserPreferences />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="analytics-behavior">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Analytics de Comportamiento</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<BehaviorAnalytics />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="segments">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Gestión de Segmentos</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<SegmentManagement />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</div>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user