import type { Metadata } from "next";
import { getCurrentCustomer } from "@/lib/auth/customer";
import { ProfileForm } from "@/components/auth/ProfileForm";

export const metadata: Metadata = { title: "Profil" };

export default async function KontoProfilPage() {
  const customer = await getCurrentCustomer();
  if (!customer) return null;

  return (
    <div className="max-w-md">
      <h2 className="font-serif text-xl font-medium text-anouma-plum">Profil</h2>
      <div className="mt-6 rounded-3xl bg-white p-6">
        <ProfileForm id={customer.id} name={customer.name} phone={customer.phone ?? ""} />
        <p className="mt-6 text-xs text-anouma-plum/60">
          E-Mail: {customer.email} — für eine Änderung der E-Mail-Adresse melde dich bitte direkt bei Anna.
        </p>
      </div>
    </div>
  );
}
