Implemented reusable components: - `TagSelector`: a customizable tag selection control with asynchronous mock data loading. - `AuthLoading`: a loading state wrapper for authentication processes. - `AdminLayout` and `DashboardLayout`: layouts with navigation and user management features. - `ThemeProvider`: supports dynamic theme toggling.
24 lines
701 B
TypeScript
24 lines
701 B
TypeScript
"use client";
|
|
|
|
import { useAuth } from "@/lib/auth-context";
|
|
import { Loader2 } from "lucide-react";
|
|
|
|
interface AuthLoadingProps {
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
export function AuthLoading({ children }: AuthLoadingProps) {
|
|
const { isLoading } = useAuth();
|
|
|
|
if (isLoading) {
|
|
return (
|
|
<div className="flex min-h-screen flex-col items-center justify-center p-4 text-center">
|
|
<Loader2 className="mb-4 h-8 w-8 animate-spin text-primary" />
|
|
<h1 className="mb-2 text-xl font-semibold">Chargement...</h1>
|
|
<p className="text-muted-foreground">Veuillez patienter pendant que nous vérifions votre authentification.</p>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return <>{children}</>;
|
|
} |