'use client' import { useState, FormEvent } from 'react' import { useAuth } from '@/contexts/AuthContext' import Link from 'next/link' import { LogIn, Mail, Lock, Building2, AlertCircle } from 'lucide-react' export default function LoginPage() { const { login } = useAuth() const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState('') const [isLoading, setIsLoading] = useState(false) const handleSubmit = async (e: FormEvent) => { e.preventDefault() setError('') setIsLoading(true) try { await login(email, password) } catch (err: any) { setError(err.message || 'فشل تسجيل الدخول. الرجاء المحاولة مرة أخرى.') } finally { setIsLoading(false) } } return (
Z.CRM - نظام إدارة علاقات العملاء
{error}
admin@system.local / Admin@123