veza/apps/web/src/features/auth/components/AuthLayout.tsx

93 lines
2.8 KiB
TypeScript
Raw Normal View History

import React from 'react';
import { Link } from 'react-router-dom';
import { cn } from '@/lib/utils';
import { Card } from '@/components/ui/card';
interface AuthLayoutProps {
title: string;
subtitle?: string;
children: React.ReactNode;
footerLinks?: Array<{ label: string; to: string }>;
className?: string;
}
export function AuthLayout({
title,
subtitle,
children,
footerLinks,
className,
}: AuthLayoutProps) {
return (
<div
className={cn(
'min-h-screen flex items-center justify-center bg-background py-12 px-4 sm:px-6 lg:px-8 relative overflow-hidden',
2025-12-13 02:34:34 +00:00
className,
)}
role="main"
aria-label="Page d'authentification"
>
{/* Background Effects */}
<div className="absolute inset-0 overflow-hidden pointer-events-none">
<div className="absolute top-0 right-0 w-96 h-96 bg-cyan/10 rounded-full blur-3xl animate-pulse" />
<div className="absolute bottom-0 left-0 w-96 h-96 bg-magenta/10 rounded-full blur-3xl animate-pulse" style={{ animationDelay: '1s' }} />
</div>
<div className="max-w-md w-full mx-auto space-y-8 relative z-10 animate-fade-in">
{/* Logo and Title */}
<header className="text-center">
<div className="flex items-center justify-center mb-6">
<div
className="h-12 w-12 rounded-xl bg-primary flex items-center justify-center shadow-button-primary-glow"
aria-hidden="true"
>
<span className="text-background font-bold text-2xl">V</span>
</div>
<span className="ml-3 font-bold text-3xl text-foreground">Veza</span>
</div>
2025-12-13 02:34:34 +00:00
<h1
id="auth-form-title"
className="text-3xl font-bold text-foreground mb-2"
2025-12-13 02:34:34 +00:00
>
{title}
</h1>
{subtitle && (
<p className="text-sm text-muted-foreground" role="doc-subtitle">
{subtitle}
</p>
)}
</header>
{/* Content Card */}
<Card
variant="surface"
padding="lg"
className="w-full"
aria-labelledby="auth-form-title"
>
{children}
</Card>
{/* Footer Links */}
{footerLinks && footerLinks.length > 0 && (
2025-12-13 02:34:34 +00:00
<nav
className="text-center space-x-4"
aria-label="Navigation d'authentification"
>
{footerLinks.map((link) => (
<Link
key={link.to}
to={link.to}
className="text-sm text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded"
>
{link.label}
</Link>
))}
</nav>
)}
</div>
</div>
);
}