This commit is contained in:
2026-03-21 20:47:22 -04:00
parent ba919bbde4
commit 4d133994ab
55 changed files with 1901 additions and 264 deletions

View File

@@ -1,6 +1,6 @@
import { useState } from 'react';
import { Link, useLocation } from 'react-router-dom';
import { Home, FileText, Activity, Search, Settings } from 'lucide-react';
import { HomeIcon, DocumentsIcon, ActivityIcon, SearchIcon, SettingsIcon } from '../icons';
import { useAuth } from '../auth/AuthContext';
import { useGetInfo } from '../generated/anthoLumeAPIV1';
@@ -12,18 +12,18 @@ interface NavItem {
}
const navItems: NavItem[] = [
{ path: '/', label: 'Home', icon: Home, title: 'Home' },
{ path: '/documents', label: 'Documents', icon: FileText, title: 'Documents' },
{ path: '/progress', label: 'Progress', icon: Activity, title: 'Progress' },
{ path: '/activity', label: 'Activity', icon: Activity, title: 'Activity' },
{ path: '/search', label: 'Search', icon: Search, title: 'Search' },
{ path: '/', label: 'Home', icon: HomeIcon, title: 'Home' },
{ path: '/documents', label: 'Documents', icon: DocumentsIcon, title: 'Documents' },
{ path: '/progress', label: 'Progress', icon: ActivityIcon, title: 'Progress' },
{ path: '/activity', label: 'Activity', icon: ActivityIcon, title: 'Activity' },
{ path: '/search', label: 'Search', icon: SearchIcon, title: 'Search' },
];
const adminSubItems: NavItem[] = [
{ path: '/admin', label: 'General', icon: Settings, title: 'General' },
{ path: '/admin/import', label: 'Import', icon: Settings, title: 'Import' },
{ path: '/admin/users', label: 'Users', icon: Settings, title: 'Users' },
{ path: '/admin/logs', label: 'Logs', icon: Settings, title: 'Logs' },
{ path: '/admin', label: 'General', icon: SettingsIcon, title: 'General' },
{ path: '/admin/import', label: 'Import', icon: SettingsIcon, title: 'Import' },
{ path: '/admin/users', label: 'Users', icon: SettingsIcon, title: 'Users' },
{ path: '/admin/logs', label: 'Logs', icon: SettingsIcon, title: 'Logs' },
];
// Helper function to check if pathname has a prefix
@@ -152,7 +152,7 @@ export default function HamburgerMenu() {
: 'text-gray-400 hover:text-gray-800 dark:hover:text-gray-100'
}`}
>
<Settings size={20} />
<SettingsIcon size={20} />
<span className="mx-4 text-sm font-normal">Admin</span>
</Link>

View File

@@ -2,7 +2,8 @@ import { useState, useEffect, useRef } from 'react';
import { Link, useLocation, Outlet, Navigate } from 'react-router-dom';
import { useGetMe } from '../generated/anthoLumeAPIV1';
import { useAuth } from '../auth/AuthContext';
import { User, ChevronDown } from 'lucide-react';
import { UserIcon } from '../icons';
import { ChevronDown } from 'lucide-react';
import HamburgerMenu from './HamburgerMenu';
export default function Layout() {
@@ -73,7 +74,7 @@ export default function Layout() {
onClick={() => setIsUserDropdownOpen(!isUserDropdownOpen)}
className="relative block text-gray-800 dark:text-gray-200"
>
<User size={20} />
<UserIcon size={20} />
</button>
{isUserDropdownOpen && (
@@ -113,7 +114,7 @@ export default function Layout() {
onClick={() => setIsUserDropdownOpen(!isUserDropdownOpen)}
className="flex cursor-pointer items-center gap-2 py-4 text-gray-500 dark:text-white"
>
<span>{userData?.username || 'User'}</span>
<span>{userData ? ('username' in userData ? userData.username : 'User') : 'User'}</span>
<span
className="text-gray-800 transition-transform duration-200 dark:text-gray-200"
style={{ transform: isUserDropdownOpen ? 'rotate(180deg)' : 'rotate(0deg)' }}