import Link from "next/link";
import { loginUser } from "@/lib/user-actions";

export default function LoginPage() {
  return (
    <main className="auth-page">
      <section className="auth-card">
        <div className="title-block" style={{ marginBottom: 18 }}>
          <h1>Login</h1>
          <p>Enter WatchLink with your username and password.</p>
        </div>
        <form className="form" action={loginUser}>
          <label>
            Username
            <input className="input" name="username" autoComplete="username" required />
          </label>
          <label>
            Password
            <input className="input" name="password" type="password" autoComplete="current-password" required />
          </label>
          <button className="button primary" type="submit">
            Login
          </button>
          <Link className="button" href="/register">
            Create account
          </Link>
        </form>
      </section>
    </main>
  );
}
