import type { ReactNode } from "react"; import { twClassNames } from "~/ui/utils"; import { Logo } from "~/ui/components/Logo"; type StatusTone = "positive" | "negative" | "neutral"; const STATUS_BADGE: Record = { positive: "bg-surface-feedback-subtle-positive", negative: "bg-surface-feedback-subtle-negative", neutral: "bg-surface-feedback-subtle-neutral", }; const STATUS_ICON: Record = { positive: "text-icon-feedback-positive", negative: "text-icon-feedback-negative", neutral: "text-icon-neutral-primary", }; // Gemeinsames Auth-Layout nach Davids Subframe-Auth-Screens (Login/Signup/Reset/2FA/Magic-Link): // zentriertes Logo (64) + Card (Titel/Untertitel + Inhalt) + optionaler Footer. min-h-screen statt Davids // h-full (Auth-Routen ohne full-height-Parent). Titel-Ausrichtung + Untertitel-Gewicht variieren je Screen // in Davids Designs -> als Props (titleAlign/subtitleStrong). twClassNames, damit cardClassName Basis-Tokens // (gap/shadow) sauber ueberschreibt. export function AuthShell({ title, subtitle, children, footer, cardClassName = "max-w-[400px]", logoIconOnly = false, titleAlign = "start", subtitleStrong = false, dataUiId, }: { title: ReactNode; subtitle?: ReactNode; children: ReactNode; footer?: ReactNode; /** Breite/Overrides der Card; Forms = max-w-[400px] (Default). */ cardClassName?: string; /** Icon-only-Logo (wie Davids 2FA-/Status-Screens) statt vollem Wortmarken-Logo. */ logoIconOnly?: boolean; /** Titel-/Untertitel-Ausrichtung. David: Login=center, Signup/Forgot/Reset/2FA=start. */ titleAlign?: "center" | "start"; /** Untertitel-Gewicht. David: Forgot/2FA = medium-150, sonst regular-0. */ subtitleStrong?: boolean; dataUiId?: string; }) { return (

{title}

{subtitle ? (

{subtitle}

) : null}
{children}
{footer ?
{footer}
: null}
); } // Status-Screen nach Davids Auth-Status-Design (Magic-Link Sent/Invalid, Forgot Sent, Reset Success ...): // volles Logo + Card mit farbigem Icon-Badge + Titel + Nachricht + optionalem Hinweis + Aktionen. export function AuthStatus({ icon, tone = "neutral", title, message, hint, children, dataUiId, }: { icon: ReactNode; tone?: StatusTone; title: ReactNode; message: ReactNode; hint?: ReactNode; /** Aktions-Buttons (vertikal gestapelt, zentriert). */ children?: ReactNode; dataUiId?: string; }) { return (
{icon}

{title}

{message}

{hint ? (

{hint}

) : null}
{children ?
{children}
: null}
); } // Davids "oder"-Trenner zwischen Primär- und Sekundär-Aktion (z.B. Login vs. Magic-Link). export function AuthDivider({ label }: { label: ReactNode }) { return (
{label}
); }