forked from fahrPool/fahrPool
25 lines
802 B
TypeScript
25 lines
802 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { loadProfile } from "@/lib/auth/profile";
|
|
import { ladeDetails } from "@/lib/nutzerverwaltung/details-queries";
|
|
import { ProfilForm } from "@/components/profil/ProfilForm";
|
|
import { Card } from "@/components/ui/Card";
|
|
|
|
export default async function ProfilPage() {
|
|
const profileResult = await loadProfile();
|
|
if (profileResult.status !== "ok") {
|
|
redirect("/login");
|
|
}
|
|
|
|
const details = await ladeDetails(profileResult.profile.id);
|
|
|
|
return (
|
|
<div className="mx-auto max-w-2xl p-4 md:p-8">
|
|
<h1 className="mb-1 text-xl font-semibold text-asphalt-grey">Mein Profil</h1>
|
|
<p className="mb-6 text-asphalt-grey">{profileResult.profile.name}</p>
|
|
<Card>
|
|
<ProfilForm details={details} />
|
|
</Card>
|
|
</div>
|
|
);
|
|
}
|