import type { Metadata } from "next";

const SITE_URL = "https://www.rajvisocialwelfare.org";

export function createMetadata({
  title,
  description,
  path = "",
  keywords = [],
  image = "/images/1.webp",
}: {
  title: string;
  description: string;
  path?: string;
  keywords?: string[];
  image?: string;
}): Metadata {
  const url = `${SITE_URL}${path}`;

  return {
    title,
    description,

    keywords: [
      "Rajvi Social Welfare Trust",
      "NGO India",
      "Social Welfare NGO",
      ...keywords,
    ],

    alternates: {
      canonical: path || "/",
    },

    openGraph: {
      title,
      description,
      url,
      siteName: "Rajvi Social Welfare Trust",
      locale: "en_IN",
      type: "website",
      images: [
        {
          url: image,
          width: 1200,
          height: 630,
          alt: title,
        },
      ],
    },

    twitter: {
      card: "summary_large_image",
      title,
      description,
      images: [image],
    },

    robots: {
      index: true,
      follow: true,
    },
  };
}