Files
Calbook/app/(auth)/anmelden/page.tsx

53 lines
2.4 KiB
TypeScript

import { PublicFooter } from "@/components/layout/public-footer";
import { SETTING_KEYS } from "@/lib/constants";
import { getSettings } from "@/lib/settings";
import { LoginForm } from "./login-form";
export const dynamic = "force-dynamic";
export default async function LoginPage() {
const settings = await getSettings([
SETTING_KEYS.COMPANY_NAME,
SETTING_KEYS.FRONTEND_HEADER_LOGO_URL,
SETTING_KEYS.FOOTER_PRIVACY_LABEL,
SETTING_KEYS.FOOTER_PRIVACY_URL,
SETTING_KEYS.FOOTER_IMPRINT_LABEL,
SETTING_KEYS.FOOTER_IMPRINT_URL,
SETTING_KEYS.FOOTER_COPYRIGHT_TEXT
]).catch(() => ({} as Record<string, string>));
const companyName = settings[SETTING_KEYS.COMPANY_NAME] ?? "CalBook";
const logoUrl = settings[SETTING_KEYS.FRONTEND_HEADER_LOGO_URL] ?? "";
return (
<div className="min-h-screen bg-slate-50 flex flex-col font-sans">
<main className="flex-1 flex items-center justify-center p-4">
<div className="w-full max-w-sm">
<div className="flex items-center justify-center gap-2 mb-6">
{logoUrl ? (
// eslint-disable-next-line @next/next/no-img-element
<img src={logoUrl} alt={companyName} className="h-10 w-10 rounded-xl object-cover border border-slate-200 bg-white" />
) : (
<div className="h-10 w-10 rounded-xl flex items-center justify-center" style={{ backgroundColor: "var(--accent)" }}>
<svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>
</div>
)}
<h1 className="text-xl font-black text-slate-900">{companyName}</h1>
</div>
<LoginForm />
</div>
</main>
<PublicFooter
companyName={companyName}
privacyLabel={settings[SETTING_KEYS.FOOTER_PRIVACY_LABEL] ?? "Datenschutz"}
privacyHref={settings[SETTING_KEYS.FOOTER_PRIVACY_URL] ?? "/datenschutz"}
imprintLabel={settings[SETTING_KEYS.FOOTER_IMPRINT_LABEL] ?? "Impressum"}
imprintHref={settings[SETTING_KEYS.FOOTER_IMPRINT_URL] ?? "/impressum"}
copyrightTemplate={settings[SETTING_KEYS.FOOTER_COPYRIGHT_TEXT] ?? "© {{year}} {{companyName}}"}
/>
</div>
);
}