mirror of
https://gitbruv.vercel.app/api/git/bruv/gitbruv.git
synced 2025-12-20 23:24:09 +01:00
55 lines
1.6 KiB
TypeScript
55 lines
1.6 KiB
TypeScript
import { redirect } from "next/navigation";
|
|
import { getCurrentUser } from "@/actions/settings";
|
|
import { EmailForm } from "@/components/settings/email-form";
|
|
import { PasswordForm } from "@/components/settings/password-form";
|
|
import { DeleteAccount } from "@/components/settings/delete-account";
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
|
|
|
export default async function AccountSettingsPage() {
|
|
const user = await getCurrentUser();
|
|
|
|
if (!user) {
|
|
redirect("/login");
|
|
}
|
|
|
|
return (
|
|
<div className="space-y-8">
|
|
<Card>
|
|
<CardHeader>
|
|
<CardTitle>Email Address</CardTitle>
|
|
<CardDescription>
|
|
Change the email associated with your account
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<EmailForm currentEmail={user.email} />
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Card>
|
|
<CardHeader>
|
|
<CardTitle>Password</CardTitle>
|
|
<CardDescription>
|
|
Update your password to keep your account secure
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<PasswordForm />
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Card className="border-red-500/20">
|
|
<CardHeader>
|
|
<CardTitle className="text-red-500">Danger Zone</CardTitle>
|
|
<CardDescription>
|
|
Irreversible actions that affect your account
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<DeleteAccount username={user.username} />
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
);
|
|
}
|
|
|