import { listCommissionCustomCardImages } from "@/actions/commissions/customCards/images";
import NewCustomCardForm from "@/components/commissions/customCards/NewCustomCardForm";
import { prisma } from "@/lib/prisma";

export default async function CommissionCustomCardsNewPage() {
  const [options, extras, images] = await Promise.all([
    prisma.commissionOption.findMany({ orderBy: [{ sortIndex: "asc" }, { name: "asc" }] }),
    prisma.commissionExtra.findMany({ orderBy: [{ sortIndex: "asc" }, { name: "asc" }] }),
    listCommissionCustomCardImages(),
  ]);

  return (
    <div>
      <div className="flex gap-4 justify-between pb-8">
        <h1 className="text-2xl font-bold mb-4">New Custom Commission Card</h1>
      </div>
      <NewCustomCardForm options={options} extras={extras} images={images} />
    </div>
  );
}
