import { redirect } from "next/navigation";
import { buildLegacyTripTypeRedirect } from "@/services/flights/legacyTripTypeRedirect";

/**
 * Retired route, kept as a redirect.
 *
 * Multi-city now lives on /srp/flights?tripType=M. This path is still out in
 * the wild — shared links, bookmarks, anything already indexed — so it
 * forwards rather than 404s, carrying every param across untouched.
 */
export default async function MultiCityFlightSearchRedirect({
  searchParams,
}: {
  searchParams: Promise<Record<string, string | string[] | undefined>>;
}) {
  redirect(buildLegacyTripTypeRedirect("multicity", await searchParams));
}
