/** * Login Template * * Pure presentation component that accepts ViewData only. * No business logic, no state management. */ 'use client'; import Link from 'next/link'; import { motion, AnimatePresence } from 'framer-motion'; import { Mail, Lock, Eye, EyeOff, LogIn, AlertCircle, Flag, Shield, } from 'lucide-react'; import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; import Input from '@/components/ui/Input'; import Heading from '@/components/ui/Heading'; import { EnhancedFormError } from '@/components/errors/EnhancedFormError'; import UserRolesPreview from '@/components/auth/UserRolesPreview'; import AuthWorkflowMockup from '@/components/auth/AuthWorkflowMockup'; import { LoginViewData } from '@/lib/builders/view-data/types/LoginViewData'; import { FormState } from '@/lib/builders/view-data/types/FormState'; interface LoginTemplateProps { viewData: LoginViewData; formActions: { handleChange: (e: React.ChangeEvent) => void; handleSubmit: (e: React.FormEvent) => Promise; setFormState: React.Dispatch>; setShowPassword: (show: boolean) => void; setShowErrorDetails: (show: boolean) => void; }; mutationState: { isPending: boolean; error: string | null; }; } export function LoginTemplate({ viewData, formActions, mutationState }: LoginTemplateProps) { return (
{/* Background Pattern */}
{/* Left Side - Info Panel (Hidden on mobile) */}
{/* Logo */}
GridPilot
Your Sim Racing Infrastructure

Manage leagues, track performance, join teams, and compete with drivers worldwide. One account, multiple roles.

{/* Role Cards */} {/* Workflow Mockup */} {/* Trust Indicators */}
Secure login
iRacing verified
{/* Right Side - Login Form */}
{/* Mobile Logo/Header */}
Welcome Back

Sign in to continue to GridPilot

{/* Desktop Header */}
Welcome Back

Sign in to access your racing dashboard

{/* Background accent */}
{/* Email */}
{/* Password */}
Forgot password?
{/* Remember Me */}
{/* Insufficient Permissions Message */} {viewData.hasInsufficientPermissions && (
Insufficient Permissions

You don't have permission to access that page. Please log in with an account that has the required role.

)}
{/* Enhanced Error Display */} {viewData.submitError && ( { formActions.setFormState((prev: FormState) => ({ ...prev, submitError: undefined })); }} showDeveloperDetails={viewData.showErrorDetails} /> )} {/* Submit Button */}
{/* Divider */}
or continue with
{/* Sign Up Link */}

Don't have an account?{''} Create one

{/* Name Immutability Notice */}
Note: Your display name cannot be changed after signup. Please ensure it's correct when creating your account.
{/* Footer */}

By signing in, you agree to our{''} Terms of Service {''}and{''} Privacy Policy

{/* Mobile Role Info */}
); }