feat: add sub nav to admin section

This commit is contained in:
Oleg Proskurin 2025-10-25 20:04:43 +07:00
parent b9a8ca8368
commit d7c230fae8
4 changed files with 38 additions and 38 deletions

View File

@ -6,7 +6,6 @@ import { createProjectApiKey, listApiKeys } from '@/lib/actions/apiKeyActions';
import KeyDisplay from '@/components/admin/KeyDisplay';
import AdminFormInput from '@/components/admin/AdminFormInput';
import AdminButton from '@/components/admin/AdminButton';
import Link from 'next/link';
const STORAGE_KEY = 'banatie_master_key';
@ -69,23 +68,7 @@ export default function ApiKeysPage() {
}
return (
<div className="relative z-10 max-w-6xl mx-auto px-6 py-16">
{/* Navigation */}
<div className="mb-8 flex gap-4">
<Link
href="/admin/master"
className="px-4 py-2 bg-slate-700 text-slate-300 rounded-lg font-medium hover:bg-slate-600"
>
Master Key
</Link>
<Link
href="/admin/apikeys"
className="px-4 py-2 bg-amber-600 text-white rounded-lg font-medium"
>
API Keys
</Link>
</div>
<div className="max-w-6xl mx-auto px-6 py-8">
{/* Page Header */}
<div className="mb-8">
<h1 className="text-4xl font-bold text-white mb-2">Project API Keys</h1>

View File

@ -0,0 +1,34 @@
'use client';
import { ReactNode } from 'react';
import { usePathname } from 'next/navigation';
import { SubsectionNav } from '@/components/shared/SubsectionNav';
interface AdminLayoutProps {
children: ReactNode;
}
const navItems = [
{ label: 'Master Key', href: '/admin/master' },
{ label: 'API Keys', href: '/admin/apikeys' },
];
export default function AdminLayout({ children }: AdminLayoutProps) {
const pathname = usePathname();
return (
<div className="min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950">
{/* Animated gradient background */}
<div className="fixed inset-0 overflow-hidden pointer-events-none">
<div className="absolute top-1/4 -left-1/4 w-96 h-96 bg-purple-600/10 rounded-full blur-3xl animate-pulse"></div>
<div className="absolute bottom-1/4 -right-1/4 w-96 h-96 bg-cyan-600/10 rounded-full blur-3xl animate-pulse delay-700"></div>
</div>
{/* Subsection Navigation */}
<SubsectionNav items={navItems} currentPath={pathname} />
{/* Page Content */}
<div className="relative z-10">{children}</div>
</div>
);
}

View File

@ -5,7 +5,6 @@ import { bootstrapMasterKey } from '@/lib/actions/apiKeyActions';
import KeyDisplay from '@/components/admin/KeyDisplay';
import AdminFormInput from '@/components/admin/AdminFormInput';
import AdminButton from '@/components/admin/AdminButton';
import Link from 'next/link';
const STORAGE_KEY = 'banatie_master_key';
@ -67,23 +66,7 @@ export default function MasterKeyPage() {
};
return (
<div className="relative z-10 max-w-4xl mx-auto px-6 py-16">
{/* Navigation */}
<div className="mb-8 flex gap-4">
<Link
href="/admin/master"
className="px-4 py-2 bg-amber-600 text-white rounded-lg font-medium"
>
Master Key
</Link>
<Link
href="/admin/apikeys"
className="px-4 py-2 bg-slate-700 text-slate-300 rounded-lg font-medium hover:bg-slate-600"
>
API Keys
</Link>
</div>
<div className="max-w-4xl mx-auto px-6 py-8">
{/* Page Header */}
<div className="mb-8">
<h1 className="text-4xl font-bold text-white mb-2">Master Key Management</h1>

View File

@ -63,8 +63,8 @@ export interface ApiKeyContextValue {
// Focus method for external components
focus: () => void;
inputRef: React.Ref<HTMLInputElement>;
containerRef: React.Ref<HTMLInputElement>;
inputRef: React.RefObject<HTMLInputElement | null>;
containerRef: React.RefObject<HTMLDivElement | null>;
}
/**