import { requireGuide } from "@/lib/auth-utils";
import { redirect } from "next/navigation";
import TourForm from "./tour-form";

export default async function CreateTourPage() {
  try {
    await requireGuide();
  } catch {
    redirect("/login");
  }

  return (
    <div className="container mx-auto px-4 py-8 max-w-4xl">
      <div className="mb-8">
        <h1 className="text-3xl font-bold mb-2">Create New Tour</h1>
        <p className="text-muted-foreground">
          Share your local expertise and create an unforgettable experience for
          travelers.
        </p>
      </div>

      <TourForm />
    </div>
  );
}
