Add src/app/admin/page.tsx
This commit is contained in:
63
src/app/admin/page.tsx
Normal file
63
src/app/admin/page.tsx
Normal file
@@ -0,0 +1,63 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from 'react';
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import NavbarLayoutFloatingOverlay from '@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay';
|
||||
import ContactSplitForm from '@/components/sections/contact/ContactSplitForm';
|
||||
|
||||
export default function AdminPage() {
|
||||
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
||||
|
||||
const handleLogin = (data: Record<string, string>) => {
|
||||
if (data.username === "admin" && data.password === "admin") {
|
||||
setIsAuthenticated(true);
|
||||
} else {
|
||||
alert("Invalid credentials");
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<ThemeProvider
|
||||
defaultButtonVariant="shift-hover"
|
||||
defaultTextAnimation="background-highlight"
|
||||
borderRadius="soft"
|
||||
contentWidth="smallMedium"
|
||||
sizing="largeSmall"
|
||||
background="noiseDiagonalGradient"
|
||||
cardStyle="gradient-radial"
|
||||
primaryButtonStyle="diagonal-gradient"
|
||||
secondaryButtonStyle="glass"
|
||||
headingFontWeight="extrabold"
|
||||
>
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingOverlay
|
||||
navItems={[
|
||||
{ name: "Home", id: "/" },
|
||||
{ name: "Admin Portal", id: "/admin" },
|
||||
]}
|
||||
brandName="Passive Gainz"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style={{ marginTop: '150px' }}>
|
||||
{!isAuthenticated ? (
|
||||
<ContactSplitForm
|
||||
title="Admin Login"
|
||||
description="Enter your credentials to access the secure administrative dashboard."
|
||||
inputs={[
|
||||
{ name: "username", type: "text", placeholder: "Username", required: true },
|
||||
{ name: "password", type: "password", placeholder: "Password", required: true }
|
||||
]}
|
||||
buttonText="Login"
|
||||
onSubmit={handleLogin}
|
||||
/>
|
||||
) : (
|
||||
<div className="p-10 text-center">
|
||||
<h1 className="text-4xl font-bold">Welcome to Admin Panel</h1>
|
||||
<p className="mt-4">System fully authenticated and operational.</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user