diff --git a/src/components/layout/AdminHeader.tsx b/src/components/layout/AdminHeader.tsx index 68706a77..a5a342ce 100644 --- a/src/components/layout/AdminHeader.tsx +++ b/src/components/layout/AdminHeader.tsx @@ -1,22 +1,28 @@ import { Shield, ArrowLeft, Settings, RefreshCw } from 'lucide-react'; import { Button } from '@/components/ui/button'; -import { Link } from 'react-router-dom'; +import { Link, useLocation } from 'react-router-dom'; import { ThemeToggle } from '@/components/theme/ThemeToggle'; import { AuthButtons } from '@/components/auth/AuthButtons'; import { useUserRole } from '@/hooks/useUserRole'; export function AdminHeader({ onRefresh }: { onRefresh?: () => void }) { const { permissions } = useUserRole(); + const location = useLocation(); + + const isSettingsPage = location.pathname === '/admin/settings'; + const backLink = isSettingsPage ? '/admin' : '/'; + const backText = isSettingsPage ? 'Back to Admin' : 'Back to ThrillWiki'; + const pageTitle = isSettingsPage ? 'Admin Settings' : 'Admin Dashboard'; return (
- {/* Left Section - Back to main site */} + {/* Left Section - Navigation */}
@@ -24,7 +30,7 @@ export function AdminHeader({ onRefresh }: { onRefresh?: () => void }) {
-

Admin Dashboard

+

{pageTitle}

@@ -39,7 +45,7 @@ export function AdminHeader({ onRefresh }: { onRefresh?: () => void }) { Refresh - {permissions?.role_level === 'superuser' && ( + {permissions?.role_level === 'superuser' && !isSettingsPage && (