@coko/client
Version:
Client side common code for coko apps
64 lines (63 loc) • 1.84 kB
JavaScript
import e from "../common/Form.js";
import t from "../common/Input.js";
import n from "../common/Page.js";
import "../common/index.js";
import r from "./AuthenticationForm.js";
import i from "./AuthenticationHeader.js";
import a from "./AuthenticationWrapper.js";
import { v4 as o } from "uuid";
import { useMemo as s } from "react";
import { jsx as c, jsxs as l } from "react/jsx-runtime";
//#region src/ui/authentication/Login.tsx
var u = (u) => {
let { className: d, errorMessage: f, hasError: p = !1, loading: m = !1, onSubmit: h } = u, g = s(() => o(), []);
return /* @__PURE__ */ c(n, {
maxWidth: 600,
children: /* @__PURE__ */ l(a, {
className: d,
children: [/* @__PURE__ */ c(i, { children: "Login" }), /* @__PURE__ */ l(r, {
alternativeActionLabel: "Do you want to signup instead?",
alternativeActionLink: "/signup",
errorMessage: f,
hasError: p,
loading: m,
onSubmit: h,
showForgotPassword: !0,
submitButtonLabel: "Log in",
title: "Login",
children: [/* @__PURE__ */ c(e.Item, {
label: "Email",
name: "email",
rules: [{
required: !0,
message: "Email is required"
}, {
type: "email",
message: "This is not a valid email address"
}],
children: /* @__PURE__ */ c(t, {
autoComplete: "email",
id: `form-${g}-email`,
placeholder: "Please enter your email",
type: "email"
})
}), /* @__PURE__ */ c(e.Item, {
label: "Password",
name: "password",
rules: [{
required: !0,
message: "Password is required"
}],
children: /* @__PURE__ */ c(t, {
autoComplete: "current-password",
id: `form-${g}-current-password`,
placeholder: "Please enter your password",
type: "password"
})
})]
})]
})
});
};
//#endregion
export { u as default };