refactor(admin): Extract moderation features into dedicated page
- Move reports, posts, and users management to new moderation page - Simplify admin page to focus on node settings configuration only - Remove unused types (AdminUser, AdminPost, Report) from admin page - Remove report resolution, post actions, and user moderation handlers - Remove tab navigation and related state management from admin page - Update sidebar navigation to include moderation page link - Consolidate moderation dashboard functionality into separate component - Improve code organization by separating concerns between admin and moderation
This commit is contained in:
@@ -7,7 +7,7 @@ import { usePathname, useRouter } from 'next/navigation';
|
||||
import { useAuth } from '@/lib/contexts/AuthContext';
|
||||
import { HomeIcon, SearchIcon, BellIcon, UserIcon, ShieldIcon, SettingsIcon, BotIcon } from './Icons';
|
||||
import { formatFullHandle } from '@/lib/utils/handle';
|
||||
import { LogOut } from 'lucide-react';
|
||||
import { LogOut, Settings2 } from 'lucide-react';
|
||||
|
||||
export function Sidebar() {
|
||||
const { user, isAdmin } = useAuth();
|
||||
@@ -118,8 +118,14 @@ export function Sidebar() {
|
||||
</Link>
|
||||
)}
|
||||
{isAdmin && (
|
||||
<Link href="/admin" className={`nav-item ${pathname?.startsWith('/admin') ? 'active' : ''}`}>
|
||||
<Link href="/moderation" className={`nav-item ${pathname?.startsWith('/moderation') ? 'active' : ''}`}>
|
||||
<ShieldIcon />
|
||||
<span>Moderation</span>
|
||||
</Link>
|
||||
)}
|
||||
{isAdmin && (
|
||||
<Link href="/admin" className={`nav-item ${pathname?.startsWith('/admin') ? 'active' : ''}`}>
|
||||
<Settings2 size={24} />
|
||||
<span>Admin</span>
|
||||
</Link>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user