Add POI feature and imporve the overall backend implementation
This commit is contained in:
@@ -588,6 +588,14 @@ export const Sidebar = forwardRef<SidebarRef, SidebarProps>(({
|
||||
);
|
||||
};
|
||||
|
||||
// Get tour attribute for navigation item
|
||||
const getTourAttribute = (path: string): string | undefined => {
|
||||
if (path === '/app/database') return 'sidebar-database';
|
||||
if (path === '/app/operations') return 'sidebar-operations';
|
||||
if (path === '/app/analytics') return 'sidebar-analytics';
|
||||
return undefined;
|
||||
};
|
||||
|
||||
// Render navigation item
|
||||
const renderItem = (item: NavigationItem, level = 0) => {
|
||||
const isActive = location.pathname === item.path || location.pathname.startsWith(item.path + '/');
|
||||
@@ -595,6 +603,7 @@ export const Sidebar = forwardRef<SidebarRef, SidebarProps>(({
|
||||
const hasChildren = item.children && item.children.length > 0;
|
||||
const isHovered = hoveredItem === item.id;
|
||||
const ItemIcon = item.icon;
|
||||
const tourAttr = getTourAttribute(item.path);
|
||||
|
||||
const itemContent = (
|
||||
<div
|
||||
@@ -676,6 +685,7 @@ export const Sidebar = forwardRef<SidebarRef, SidebarProps>(({
|
||||
onClick={() => handleItemClick(item)}
|
||||
disabled={item.disabled}
|
||||
data-path={item.path}
|
||||
data-tour={tourAttr}
|
||||
onMouseEnter={() => {
|
||||
if (isCollapsed && hasChildren && level === 0 && item.children && item.children.length > 0) {
|
||||
setHoveredItem(item.id);
|
||||
|
||||
Reference in New Issue
Block a user