"use client";

import { useEffect } from "react";
import { useParams, useRouter } from "next/navigation";

/** Old thread URLs → /forum/post/[id] */
export default function LegacyForumThreadRedirect() {
  const params = useParams();
  const router = useRouter();
  const id = typeof params.id === "string" ? params.id : "";

  useEffect(() => {
    if (id) router.replace(`/forum/post/${id}`);
  }, [id, router]);

  return (
    <p className="font-mono text-sm text-[#8a7d6b]">Redirecting…</p>
  );
}
