import { redirect } from "next/navigation";

// ── Page ──────────────────────────────────────────────────────────────────────

interface PageProps {
  params: Promise<{ cad: string }>;
}

// The ПТИЦА cockpit is now rendered by the parent `[cad]/page.tsx` route, so
// this subroute is redundant — it permanently redirects to the parent to avoid
// two divergent copies of PticaPageContent. Old `/site-finder/analysis/{cad}/
// ptica` links (and any cached bookmarks) keep working via this hop.
export default async function PticaSubroutePage({ params }: PageProps) {
  const { cad: cadRaw } = await params;
  // `cad` arrives URL-encoded; keep it encoded for the redirect target so the
  // canonical decode happens once in the parent page boundary.
  redirect(`/site-finder/analysis/${cadRaw}`);
}
