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

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