2025-12-03 21:56:50 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
|
import { cn } from '@/lib/utils';
|
|
|
|
|
|
2026-01-26 13:12:17 +00:00
|
|
|
import { Card } from '@/components/ui/card';
|
|
|
|
|
|
2025-12-03 21:56:50 +00:00
|
|
|
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(
|
2026-01-26 13:12:17 +00:00
|
|
|
'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,
|
2025-12-03 21:56:50 +00:00
|
|
|
)}
|
|
|
|
|
role="main"
|
|
|
|
|
aria-label="Page d'authentification"
|
|
|
|
|
>
|
2026-01-11 15:30:43 +00:00
|
|
|
{/* Background Effects */}
|
|
|
|
|
<div className="absolute inset-0 overflow-hidden pointer-events-none">
|
2026-01-26 13:12:17 +00:00
|
|
|
<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' }} />
|
2026-01-11 15:30:43 +00:00
|
|
|
</div>
|
|
|
|
|
|
2026-02-07 18:52:12 +00:00
|
|
|
<div className="max-w-md w-full mx-auto space-y-8 relative z-10 animate-fade-in">
|
2025-12-03 21:56:50 +00:00
|
|
|
{/* Logo and Title */}
|
|
|
|
|
<header className="text-center">
|
2026-01-11 15:30:43 +00:00
|
|
|
<div className="flex items-center justify-center mb-6">
|
2025-12-03 21:56:50 +00:00
|
|
|
<div
|
2026-02-07 18:52:12 +00:00
|
|
|
className="h-12 w-12 rounded-xl bg-primary flex items-center justify-center shadow-[0_0_20px_var(--color-primary)/0.4]"
|
2025-12-03 21:56:50 +00:00
|
|
|
aria-hidden="true"
|
|
|
|
|
>
|
2026-01-26 13:12:17 +00:00
|
|
|
<span className="text-background font-bold text-2xl">V</span>
|
2025-12-03 21:56:50 +00:00
|
|
|
</div>
|
2026-01-26 13:12:17 +00:00
|
|
|
<span className="ml-3 font-bold text-3xl text-foreground">Veza</span>
|
2025-12-03 21:56:50 +00:00
|
|
|
</div>
|
2025-12-13 02:34:34 +00:00
|
|
|
<h1
|
|
|
|
|
id="auth-form-title"
|
2026-01-26 13:12:17 +00:00
|
|
|
className="text-3xl font-bold text-foreground mb-2"
|
2025-12-13 02:34:34 +00:00
|
|
|
>
|
2025-12-03 21:56:50 +00:00
|
|
|
{title}
|
|
|
|
|
</h1>
|
|
|
|
|
{subtitle && (
|
2026-01-26 13:12:17 +00:00
|
|
|
<p className="text-sm text-muted-foreground" role="doc-subtitle">
|
2025-12-03 21:56:50 +00:00
|
|
|
{subtitle}
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
{/* Content Card */}
|
2026-01-26 13:12:17 +00:00
|
|
|
<Card
|
2026-02-07 18:52:12 +00:00
|
|
|
variant="surface"
|
2026-01-26 13:12:17 +00:00
|
|
|
padding="lg"
|
2026-02-07 18:52:12 +00:00
|
|
|
className="w-full"
|
2025-12-03 21:56:50 +00:00
|
|
|
aria-labelledby="auth-form-title"
|
|
|
|
|
>
|
|
|
|
|
{children}
|
2026-01-26 13:12:17 +00:00
|
|
|
</Card>
|
2025-12-03 21:56:50 +00:00
|
|
|
|
|
|
|
|
{/* 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"
|
|
|
|
|
>
|
2025-12-03 21:56:50 +00:00
|
|
|
{footerLinks.map((link) => (
|
|
|
|
|
<Link
|
|
|
|
|
key={link.to}
|
|
|
|
|
to={link.to}
|
2026-02-07 15:02:52 +00:00
|
|
|
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"
|
2025-12-03 21:56:50 +00:00
|
|
|
>
|
|
|
|
|
{link.label}
|
|
|
|
|
</Link>
|
|
|
|
|
))}
|
|
|
|
|
</nav>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|