diff --git a/application/src/components/dashboard/sidebar/MenuItem.tsx b/application/src/components/dashboard/sidebar/MenuItem.tsx index ec9f8cd..2953f97 100644 --- a/application/src/components/dashboard/sidebar/MenuItem.tsx +++ b/application/src/components/dashboard/sidebar/MenuItem.tsx @@ -1,10 +1,8 @@ - import React from "react"; import { useLocation, useNavigate } from "react-router-dom"; import { useTheme } from "@/contexts/ThemeContext"; import { useLanguage } from "@/contexts/LanguageContext"; import { LucideIcon } from "lucide-react"; - interface MenuItemProps { id: string; path: string | null; @@ -14,7 +12,6 @@ interface MenuItemProps { hasNavigation: boolean; collapsed: boolean; } - export const MenuItem: React.FC = ({ id, path, @@ -24,41 +21,36 @@ export const MenuItem: React.FC = ({ hasNavigation, collapsed }) => { - const { theme } = useTheme(); - const { t } = useLanguage(); + const { + theme + } = useTheme(); + const { + t + } = useLanguage(); const location = useLocation(); const navigate = useNavigate(); - const handleClick = (e: React.MouseEvent) => { e.preventDefault(); e.stopPropagation(); - if (hasNavigation && path) { - navigate(path, { replace: false }); + navigate(path, { + replace: false + }); } }; - const isActive = path && location.pathname === path; const mainIconSize = "h-6 w-6"; - - return ( -
+ `} onClick={handleClick}> - {!collapsed && ( - + {!collapsed && {t(translationKey)} - - )} -
- ); + } + ; }; \ No newline at end of file