+
-
Welcome to Your Blank App
-
Start building your amazing project here!
+
+
Loading...
);
};
-export default Index;
+export default Index;
\ No newline at end of file
diff --git a/application/src/pages/OperationalPage.tsx b/application/src/pages/OperationalPage.tsx
index dc44a43..ccfd3ed 100644
--- a/application/src/pages/OperationalPage.tsx
+++ b/application/src/pages/OperationalPage.tsx
@@ -1,15 +1,15 @@
-import React, { useState } from "react";
+import React from "react";
import { Header } from "@/components/dashboard/Header";
import { Sidebar } from "@/components/dashboard/Sidebar";
import { OperationalPageContent } from '@/components/operational-page/OperationalPageContent';
import { authService } from "@/services/authService";
import { useNavigate } from "react-router-dom";
+import { useSidebar } from "@/contexts/SidebarContext";
const OperationalPage = () => {
- // State for sidebar collapse functionality
- const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
- const toggleSidebar = () => setSidebarCollapsed(prev => !prev);
+ // Use shared sidebar state
+ const { sidebarCollapsed, toggleSidebar } = useSidebar();
// Get current user
const currentUser = authService.getCurrentUser();
diff --git a/application/src/pages/Profile.tsx b/application/src/pages/Profile.tsx
index 0ba6aed..7126fb2 100644
--- a/application/src/pages/Profile.tsx
+++ b/application/src/pages/Profile.tsx
@@ -9,11 +9,11 @@ import { ProfileContent } from "@/components/profile/ProfileContent";
import { User } from "@/services/userService";
import { useToast } from "@/hooks/use-toast";
import { Loader2 } from "lucide-react";
+import { useSidebar } from "@/contexts/SidebarContext";
const Profile = () => {
- // State for sidebar collapse functionality
- const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
- const toggleSidebar = () => setSidebarCollapsed(prev => !prev);
+ // Use shared sidebar state
+ const { sidebarCollapsed, toggleSidebar } = useSidebar();
// Get current user
const currentUser = authService.getCurrentUser();
diff --git a/application/src/pages/ScheduleIncident.tsx b/application/src/pages/ScheduleIncident.tsx
index 6adef1f..c58cb62 100644
--- a/application/src/pages/ScheduleIncident.tsx
+++ b/application/src/pages/ScheduleIncident.tsx
@@ -1,5 +1,5 @@
-import React, { useState, useEffect } from 'react';
+import React, { useEffect } from 'react';
import { Header } from "@/components/dashboard/Header";
import { Sidebar } from "@/components/dashboard/Sidebar";
import { useTheme } from "@/contexts/ThemeContext";
@@ -8,11 +8,11 @@ import { ScheduleIncidentContent } from "@/components/schedule-incident/Schedule
import { authService } from "@/services/authService";
import { useNavigate } from "react-router-dom";
import { initMaintenanceNotifications, stopMaintenanceNotifications } from "@/services/maintenance/maintenanceNotificationService";
+import { useSidebar } from "@/contexts/SidebarContext";
const ScheduleIncident = () => {
- // State for sidebar collapse functionality
- const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
- const toggleSidebar = () => setSidebarCollapsed(prev => !prev);
+ // Use shared sidebar state
+ const { sidebarCollapsed, toggleSidebar } = useSidebar();
// Get current theme and language
const { theme } = useTheme();
@@ -24,12 +24,10 @@ const ScheduleIncident = () => {
// Initialize maintenance notifications
useEffect(() => {
- console.log("Initializing maintenance notifications");
initMaintenanceNotifications();
// Clean up on unmount
return () => {
- console.log("Stopping maintenance notifications");
stopMaintenanceNotifications();
};
}, []);
diff --git a/application/src/pages/Settings.tsx b/application/src/pages/Settings.tsx
index 6dd3516..45c2018 100644
--- a/application/src/pages/Settings.tsx
+++ b/application/src/pages/Settings.tsx
@@ -10,11 +10,11 @@ import { NotificationSettings } from "@/components/settings/notification-setting
import { AlertsTemplates } from "@/components/settings/alerts-templates";
import { AboutSystem } from "@/components/settings/about-system";
import DataRetentionSettings from "@/components/settings/data-retention/DataRetentionSettings";
+import { useSidebar } from "@/contexts/SidebarContext";
const Settings = () => {
- // State for sidebar collapse functionality
- const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
- const toggleSidebar = () => setSidebarCollapsed(prev => !prev);
+ // Use shared sidebar state
+ const { sidebarCollapsed, toggleSidebar } = useSidebar();
// Get current user
const currentUser = authService.getCurrentUser();
diff --git a/application/src/pages/SslDomain.tsx b/application/src/pages/SslDomain.tsx
index cf20c3d..a7de6ee 100644
--- a/application/src/pages/SslDomain.tsx
+++ b/application/src/pages/SslDomain.tsx
@@ -1,3 +1,4 @@
+
import React, { useEffect } from "react";
import { useQuery } from "@tanstack/react-query";
import { authService } from "@/services/authService";
@@ -8,14 +9,14 @@ import { SSLDomainContent } from "@/components/ssl-domain/SSLDomainContent";
import { LoadingState } from "@/components/services/LoadingState";
import { fetchSSLCertificates, shouldRunDailyCheck, checkAllCertificatesAndNotify } from "@/services/sslCertificateService";
import { useLanguage } from "@/contexts/LanguageContext";
+import { useSidebar } from "@/contexts/SidebarContext";
const SslDomain = () => {
// Get language context for translations
const { t } = useLanguage();
- // State for sidebar collapse functionality
- const [sidebarCollapsed, setSidebarCollapsed] = React.useState(false);
- const toggleSidebar = () => setSidebarCollapsed(prev => !prev);
+ // Use shared sidebar state
+ const { sidebarCollapsed, toggleSidebar } = useSidebar();
// Get current user
const currentUser = authService.getCurrentUser();