import { redirect } from "next/navigation";
import { getSession } from "@/lib/auth";
import { ProjectForm } from "../ProjectForm";

export default async function NewProjectPage() {
  const session = await getSession();
  if (!session.isLoggedIn) redirect("/admin/login");
  return (
    <div>
      <div className="mb-6">
        <a href="/admin/projects" className="text-sm text-text-secondary hover:text-accent">← برگشت به پروژه‌ها</a>
        <h1 className="mt-2 text-2xl font-bold text-text-primary">پروژه جدید</h1>
      </div>
      <ProjectForm />
    </div>
  );
}
