feat: implement user account management features including profile display and password change functionality
This commit is contained in:
34
src/app/account/page.tsx
Normal file
34
src/app/account/page.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { UserProfileCard } from "@/components/account/UserProfileCard";
|
||||
import { ChangePasswordForm } from "@/components/account/ChangePasswordForm";
|
||||
import { UserService } from "@/lib/services/user.service";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function AccountPage() {
|
||||
try {
|
||||
const [profile, stats] = await Promise.all([
|
||||
UserService.getUserProfile(),
|
||||
UserService.getUserStats(),
|
||||
]);
|
||||
|
||||
return (
|
||||
<div className="container mx-auto px-4 py-8">
|
||||
<div className="max-w-4xl mx-auto space-y-8">
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold">Mon compte</h1>
|
||||
<p className="text-muted-foreground mt-2">
|
||||
Gérez vos informations personnelles et votre sécurité
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-6 md:grid-cols-2">
|
||||
<UserProfileCard profile={{ ...profile, stats }} />
|
||||
<ChangePasswordForm />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Erreur lors du chargement du compte:", error);
|
||||
redirect("/login");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user