omninexus-ai / components /AdminLogin.tsx
aditya9708's picture
Auto-deploy from AI Studio
e4c7604 verified
Raw History Blame Contribute Delete
3.2 kB
import React, { useState } from 'react';
interface AdminLoginProps {
onLoginSuccess: () => void;
onCancel: () => void;
}
const AdminLogin: React.FC<AdminLoginProps> = ({ onLoginSuccess, onCancel }) => {
const [userId, setUserId] = useState('');
const [password, setPassword] = useState('');
const [error, setError] = useState('');
const [isProcessing, setIsProcessing] = useState(false);
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
setIsProcessing(true);
setError('');
// Aapka secret login
setTimeout(() => {
if (userId.toLowerCase() === 'admin' && password === 'aditya@77') {
onLoginSuccess();
} else {
setError('Galat ID ya Password! Phir se try karo.');
setIsProcessing(false);
}
}, 1200);
};
return (
<div className="min-h-screen bg-[#020617] flex items-center justify-center p-6 font-sans">
<div className="w-full max-w-md bg-[#0a0f1e] border border-indigo-500/20 rounded-[40px] p-12 shadow-3xl text-center">
<div className="w-20 h-20 bg-indigo-600 rounded-3xl flex items-center justify-center mx-auto mb-8 shadow-2xl">
<svg className="w-10 h-10 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2.5} d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" /></svg>
</div>
<h2 className="text-3xl font-black text-white mb-2 uppercase italic tracking-tighter">Owner Terminal</h2>
<p className="text-[10px] text-slate-500 font-bold uppercase tracking-widest mb-10">Authentication Required</p>
<form onSubmit={handleSubmit} className="space-y-6">
<input
type="text"
value={userId}
onChange={(e) => setUserId(e.target.value)}
className="w-full bg-[#020617] border border-slate-800 rounded-2xl px-6 py-4 text-white focus:border-indigo-500 outline-none transition-all placeholder:text-slate-800"
placeholder="Username (admin)"
required
/>
<input
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
className="w-full bg-[#020617] border border-slate-800 rounded-2xl px-6 py-4 text-white focus:border-indigo-500 outline-none transition-all placeholder:text-slate-800"
placeholder="Password (aditya@77)"
required
/>
{error && <p className="text-red-500 text-xs font-bold uppercase">{error}</p>}
<button
type="submit"
disabled={isProcessing}
className="w-full py-5 bg-indigo-600 text-white rounded-2xl font-black uppercase text-xs tracking-widest shadow-2xl hover:scale-105 active:scale-95 transition-all"
>
{isProcessing ? 'Verifying...' : 'Login to Admin'}
</button>
</form>
<button onClick={onCancel} className="mt-8 text-[10px] text-slate-600 font-black uppercase hover:text-white transition-colors">Go Back</button>
</div>
</div>
);
};
export default AdminLogin;