www_site/components/auth-form.tsx

19 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Link from "next/link";
import { PreviewNotice } from "@/components/ui";
export function AuthForm({ mode }: { mode: "login" | "register" }) {
const isLogin = mode === "login";
return (
<div className="w-full max-w-md rounded-2xl border border-line bg-panel/70 p-6 sm:p-8">
<PreviewNotice></PreviewNotice>
<form className="mt-8 space-y-5">
<div><label className="field-label" htmlFor="email"></label><input className="field-input" disabled id="email" placeholder="name@example.com" type="email" /></div>
<div><label className="field-label" htmlFor="password"></label><input className="field-input" disabled id="password" placeholder="至少 8 位字符" type="password" /></div>
{!isLogin ? <div><label className="field-label" htmlFor="password-confirm"></label><input className="field-input" disabled id="password-confirm" placeholder="再次输入密码" type="password" /></div> : null}
<button className="button-primary w-full" disabled type="submit">{isLogin ? "登录(待接入)" : "注册(待接入)"}</button>
</form>
<p className="mt-6 text-center text-sm text-muted">{isLogin ? "还没有账户?" : "已有账户?"}{" "}<Link className="text-cyan hover:text-copy" href={isLogin ? "/register" : "/login"}>{isLogin ? "去注册" : "去登录"}</Link></p>
</div>
);
}