import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { Eye, EyeOff, User, Lock, ArrowRight, Building2, CalendarClock, Users, FileCheck2, ShieldCheck } from 'lucide-react';
import { useToast, ToastContainer } from '../../components/UI/Toast';
const features = [
{ icon: CalendarClock, label: 'Schedule batches across every branch from one calendar' },
{ icon: Users, label: 'Track trainer availability, attendance, and performance' },
{ icon: FileCheck2, label: 'Auto-generate GST-ready invoices and certificates' },
];
const stats = [
{ value: '500+', label: 'Batches managed' },
{ value: '50+', label: 'Active trainers' },
{ value: '12k+', label: 'Students trained' },
];
const Login = () => {
const navigate = useNavigate();
const toast = useToast();
const [showPassword, setShowPassword] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [formData, setFormData] = useState({
username: '',
password: '',
rememberMe: false,
});
const handleInputChange = (field: string, value: any) => {
setFormData((prev) => ({ ...prev, [field]: value }));
};
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
// Basic validation
if (!formData.username || !formData.password) {
toast.error('Please fill in all fields');
return;
}
setIsLoading(true);
// Simulate API call
setTimeout(() => {
setIsLoading(false);
// Store authentication token
if (formData.rememberMe) {
localStorage.setItem('authToken', 'demo-token-12345');
} else {
sessionStorage.setItem('authToken', 'demo-token-12345');
}
toast.success('Login successful!');
navigate('/dashboard'); // Redirect to dashboard or home
}, 1500);
};
return (
<>
Branches, batches, trainers, and billing — one ERP built specifically for training organizations.
Sign in to your UpSkill365 account to continue
© {new Date().getFullYear()} UpSkill365. All rights reserved.