import React, { useState } from 'react'; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { useAuth } from "@/hooks/useAuth"; import { useToast } from "@/hooks/use-toast"; interface LoginPageProps { onLogin: () => void; } export const LoginPage = ({ onLogin }: LoginPageProps) => { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [loading, setLoading] = useState(false); const { signIn } = useAuth(); const { toast } = useToast(); const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); try { const { error } = await signIn(email, password); if (error) { toast({ title: "Login Error", description: error.message, variant: "destructive" }); return; } toast({ title: "Success", description: "Logged in successfully!" }); onLogin(); } catch (err) { toast({ title: "Error", description: "An unexpected error occurred", variant: "destructive" }); } finally { setLoading(false); } }; return (
Real-time Cash Reconciliation – Ensuring Accuracy & Transparency