import { localizedMetadata } from "@/lib/i18n/serverMetadata";
import type { Metadata } from "next";
import { redirect } from "next/navigation";

const pageMetadata: Metadata = {
  title: "Volunteer profile",
  robots: { index: false, follow: false },
};

export async function generateMetadata(): Promise<Metadata> {
  return localizedMetadata(pageMetadata);
}

/*
 * The limited "private account" view was removed with the «حساب خاص» switch
 * (client, 2026-10-18): every profile is `/public-profile/{id}`. Kept as a
 * redirect so saved and shared links still land on the profile.
 */
export default async function Page({
  params,
}: {
  params: Promise<{ id: string }>;
}) {
  const { id } = await params;
  redirect(`/public-profile/${encodeURIComponent(id)}`);
}
