import { redirect } from "next/navigation";
import { getCurrentUser } from "@/lib/auth";
import SettingsForm from "@/components/settings/SettingsForm";

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

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

  return (
    <div className="min-h-screen bg-[#0A0A0A]">
      <div className="border-b border-zinc-800 px-4 py-4 sm:px-6">
        <div className="max-w-2xl mx-auto">
          <h1 className="text-2xl font-bold text-white">Settings</h1>
          <p className="text-zinc-500 text-sm mt-1">
            Manage your preferences and account
          </p>
        </div>
      </div>

      <div className="max-w-2xl mx-auto px-4 py-6 sm:px-6">
        <SettingsForm user={user} />
      </div>
    </div>
  );
}
