import { redirect } from "next/navigation";
import { getCurrentUser } from "@/lib/auth-utils";
import ProfileContent from "./profile-content";

export const metadata = {
  title: "My Profile | ZuriGuide",
  description: "Manage your profile settings",
};

export default async function ProfilePage() {
  const user = await getCurrentUser();

  if (!user) {
    redirect("/login");
  }

  return <ProfileContent user={{...user, createdAt: user.createdAt.toISOString()}} />;
}
