import Link from "next/link";
import { ArrowLeft } from "lucide-react";
import { AdForm } from "@/components/admin/AdForm";

interface NewAdPageProps {
  searchParams: Promise<{ slot?: string }>;
}

export default async function NewAdPage({ searchParams }: NewAdPageProps) {
  const { slot } = await searchParams;

  return (
    <div className="space-y-6">
      <Link
        href="/admin/ads"
        className="inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-primary"
      >
        <ArrowLeft className="size-4" />
        返回廣告列表
      </Link>
      <h1 className="text-2xl font-bold">新增廣告</h1>
      <AdForm defaultSlot={slot} />
    </div>
  );
}