"use client" import { useState } from "react" import { useRouter } from "next/navigation" import { api } from "@/lib/api" import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { HardDrive, AlertCircle } from "lucide-react" export default function LoginPage() { const router = useRouter() const [username, setUsername] = useState("") const [password, setPassword] = useState("") const [error, setError] = useState(null) const [loading, setLoading] = useState(false) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setError(null) setLoading(true) try { await api.login(username, password) router.push("/") } catch (err) { const message = err instanceof Error ? err.message : "Login failed. Please check your credentials." setError(message) } finally { setLoading(false) } } return (
{/* Logo */}

ZMB Webui

{/* Login Card */} Sign In Enter your credentials to access the ZMB Webui
{/* Error Message */} {error && (

{error}

)} {/* Username Field */}
setUsername(e.target.value)} placeholder="Username" className="w-full px-3 py-2 border border-input rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-ring" disabled={loading} />
{/* Password Field */}
setPassword(e.target.value)} placeholder="Enter your password" className="w-full px-3 py-2 border border-input rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-ring" disabled={loading} />
{/* Submit Button */}
{/* Help Text */}

Use your Samba credentials

{/* Footer */}

ZMB Webui v1.0.0

) }