|
@@ -1,9 +1,3 @@
|
|
|
-// ---------------------------------------------------------------------------
|
|
|
|
|
-// Folder: components/auth
|
|
|
|
|
-// File: LoginForm.jsx
|
|
|
|
|
-// Relative Path: components/auth/LoginForm.jsx
|
|
|
|
|
-// ---------------------------------------------------------------------------
|
|
|
|
|
-
|
|
|
|
|
"use client";
|
|
"use client";
|
|
|
|
|
|
|
|
import React from "react";
|
|
import React from "react";
|
|
@@ -41,6 +35,9 @@ import {
|
|
|
* NOTE:
|
|
* NOTE:
|
|
|
* - Password is NOT normalized. It remains case-sensitive.
|
|
* - Password is NOT normalized. It remains case-sensitive.
|
|
|
*
|
|
*
|
|
|
|
|
+ * UX rule:
|
|
|
|
|
+ * - All user-facing text must be German.
|
|
|
|
|
+ *
|
|
|
* @param {{ reason: string|null, nextPath: string|null }} props
|
|
* @param {{ reason: string|null, nextPath: string|null }} props
|
|
|
*/
|
|
*/
|
|
|
export default function LoginForm({ reason, nextPath }) {
|
|
export default function LoginForm({ reason, nextPath }) {
|
|
@@ -68,7 +65,7 @@ export default function LoginForm({ reason, nextPath }) {
|
|
|
const p = password; // do NOT normalize password
|
|
const p = password; // do NOT normalize password
|
|
|
|
|
|
|
|
if (!u || !p) {
|
|
if (!u || !p) {
|
|
|
- setErrorMessage("Please enter username and password.");
|
|
|
|
|
|
|
+ setErrorMessage("Bitte Benutzername und Passwort eingeben.");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -87,9 +84,9 @@ export default function LoginForm({ reason, nextPath }) {
|
|
|
return (
|
|
return (
|
|
|
<Card>
|
|
<Card>
|
|
|
<CardHeader>
|
|
<CardHeader>
|
|
|
- <CardTitle>Sign in</CardTitle>
|
|
|
|
|
|
|
+ <CardTitle>Anmeldung</CardTitle>
|
|
|
<CardDescription>
|
|
<CardDescription>
|
|
|
- Enter your credentials to access the delivery note browser.
|
|
|
|
|
|
|
+ Bitte geben Sie Ihre Zugangsdaten ein, um die Lieferscheine zu öffnen.
|
|
|
</CardDescription>
|
|
</CardDescription>
|
|
|
</CardHeader>
|
|
</CardHeader>
|
|
|
|
|
|
|
@@ -103,14 +100,14 @@ export default function LoginForm({ reason, nextPath }) {
|
|
|
|
|
|
|
|
{errorMessage ? (
|
|
{errorMessage ? (
|
|
|
<Alert variant="destructive">
|
|
<Alert variant="destructive">
|
|
|
- <AlertTitle>Login error</AlertTitle>
|
|
|
|
|
|
|
+ <AlertTitle>Anmeldung fehlgeschlagen</AlertTitle>
|
|
|
<AlertDescription>{errorMessage}</AlertDescription>
|
|
<AlertDescription>{errorMessage}</AlertDescription>
|
|
|
</Alert>
|
|
</Alert>
|
|
|
) : null}
|
|
) : null}
|
|
|
|
|
|
|
|
<form onSubmit={onSubmit} className="space-y-4">
|
|
<form onSubmit={onSubmit} className="space-y-4">
|
|
|
<div className="grid gap-2">
|
|
<div className="grid gap-2">
|
|
|
- <Label htmlFor="username">Username</Label>
|
|
|
|
|
|
|
+ <Label htmlFor="username">Benutzername</Label>
|
|
|
<Input
|
|
<Input
|
|
|
id="username"
|
|
id="username"
|
|
|
name="username"
|
|
name="username"
|
|
@@ -125,12 +122,12 @@ export default function LoginForm({ reason, nextPath }) {
|
|
|
setUsername(e.target.value.toLowerCase());
|
|
setUsername(e.target.value.toLowerCase());
|
|
|
}}
|
|
}}
|
|
|
disabled={isSubmitting}
|
|
disabled={isSubmitting}
|
|
|
- placeholder="e.g. branchuser"
|
|
|
|
|
|
|
+ placeholder="z. B. branchuser"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div className="grid gap-2">
|
|
<div className="grid gap-2">
|
|
|
- <Label htmlFor="password">Password</Label>
|
|
|
|
|
|
|
+ <Label htmlFor="password">Passwort</Label>
|
|
|
<Input
|
|
<Input
|
|
|
id="password"
|
|
id="password"
|
|
|
name="password"
|
|
name="password"
|
|
@@ -145,7 +142,7 @@ export default function LoginForm({ reason, nextPath }) {
|
|
|
|
|
|
|
|
<CardFooter className="p-0">
|
|
<CardFooter className="p-0">
|
|
|
<Button type="submit" className="w-full" disabled={isSubmitting}>
|
|
<Button type="submit" className="w-full" disabled={isSubmitting}>
|
|
|
- {isSubmitting ? "Signing in..." : "Sign in"}
|
|
|
|
|
|
|
+ {isSubmitting ? "Anmeldung…" : "Anmelden"}
|
|
|
</Button>
|
|
</Button>
|
|
|
</CardFooter>
|
|
</CardFooter>
|
|
|
</form>
|
|
</form>
|