- {/* Background circle */}
+
-
- {/* Percentage text */}
+
{Math.round(progress)}%
-
- {/* Loading text */}
+
Loading Model...
diff --git a/frontend/components/ui/Sidebar.tsx b/frontend/components/ui/Sidebar.tsx
index 7f6e782..bfeb086 100644
--- a/frontend/components/ui/Sidebar.tsx
+++ b/frontend/components/ui/Sidebar.tsx
@@ -24,67 +24,53 @@ interface SidebarProps {
activeItem?: number | null
onCustomItemClick?: (itemId: number) => boolean
}
+
+const IconWrapper = ({ src, alt, className }: { src: string; alt: string; className?: string }) => (
+
+
+
+)
-// Иконки-заглушки
const BookOpen = ({ className }: { className?: string }) => (
-
+
)
const Bot = ({ className }: { className?: string }) => (
-
+
)
const SquareTerminal = ({ className }: { className?: string }) => (
-
+
)
const CircleDot = ({ className }: { className?: string }) => (
-
+
)
const BellDot = ({ className }: { className?: string }) => (
-
+
)
const History = ({ className }: { className?: string }) => (
-
+
)
const Settings2 = ({ className }: { className?: string }) => (
-
+
)
const Monitor = ({ className }: { className?: string }) => (
-
+
)
const Building = ({ className }: { className?: string }) => (
-
+
)
// основные routes
@@ -195,21 +181,19 @@ const Sidebar: React.FC
= ({
const handleItemClick = (itemId: number) => {
let handled = false
- // Handle submenu items directly with navigation store
+ // Управление суб-меню через navigationStore (суб-меню - работают как отдельные элементы, но не страницы)
switch (itemId) {
- case 2: // Navigation - only navigate to page, don't open submenus
+ case 2:
if (pathname !== '/navigation') {
router.push('/navigation')
}
handled = true
break
case 3: // Monitoring
- if (pathname !== '/navigation') {
- // Navigate to navigation page first, then open monitoring
+ if (pathname !== '/navigation') {
router.push('/navigation')
setTimeout(() => openMonitoring(), 100)
- } else if (showMonitoring) {
- // Close if already open
+ } else if (showMonitoring) {
closeMonitoring()
} else {
openMonitoring()
@@ -217,12 +201,10 @@ const Sidebar: React.FC = ({
handled = true
break
case 4: // Floor Navigation
- if (pathname !== '/navigation') {
- // Navigate to navigation page first, then open floor navigation
+ if (pathname !== '/navigation') {
router.push('/navigation')
setTimeout(() => openFloorNavigation(), 100)
- } else if (showFloorNavigation) {
- // Close if already open
+ } else if (showFloorNavigation) {
closeFloorNavigation()
} else {
openFloorNavigation()
@@ -230,12 +212,10 @@ const Sidebar: React.FC = ({
handled = true
break
case 5: // Notifications
- if (pathname !== '/navigation') {
- // Navigate to navigation page first, then open notifications
+ if (pathname !== '/navigation') {
router.push('/navigation')
setTimeout(() => openNotifications(), 100)
- } else if (showNotifications) {
- // Close if already open
+ } else if (showNotifications) {
closeNotifications()
} else {
openNotifications()
@@ -243,20 +223,18 @@ const Sidebar: React.FC = ({
handled = true
break
default:
- // For other items, use navigation service
+ // Для остального используем routes
if (navigationService) {
handled = navigationService.handleSidebarItemClick(itemId, pathname)
}
break
}
- if (handled) {
- // Update internal active item state
+ if (handled) {
if (propActiveItem === undefined) {
setInternalActiveItem(itemId)
}
-
- // Call custom handler if provided (for additional logic)
+
if (onCustomItemClick) {
onCustomItemClick(itemId)
}
@@ -273,22 +251,14 @@ const Sidebar: React.FC = ({
>