import type { Metadata } from "next";

const SITE_NAME = "Rajvi Social Welfare Trust";
const SITE_URL = "https://www.rajvisocialwelfare.org";

interface SEOProps {
  title: string;
  description: string;
  path?: string;
  image?: string;
  keywords?: string[];
}

export function generateSEO({
  title,
  description,
  path = "",
  image = "/images/1.webp",
  keywords = [],
}: SEOProps): Metadata {
  const url = `${SITE_URL}${path}`;

  return {
    title,
    description,

    keywords: [
      "Rajvi Social Welfare Trust",
      "NGO India",
      "Social Welfare NGO",
      "Education Support",
      "Healthcare Awareness",
      "Women Empowerment",
      "Youth Development",
      "Community Welfare",
      ...keywords,
    ],

    alternates: {
      canonical: path || "/",
    },

    robots: {
      index: true,
      follow: true,
      googleBot: {
        index: true,
        follow: true,
        "max-image-preview": "large",
        "max-snippet": -1,
        "max-video-preview": -1,
      },
    },

    openGraph: {
      title,
      description,
      url,
      siteName: SITE_NAME,
      locale: "en_IN",
      type: "website",

      images: [
        {
          url: image,
          width: 1200,
          height: 630,
          alt: title,
        },
      ],
    },

    twitter: {
      card: "summary_large_image",
      title,
      description,
      images: [image],
    },
  };
}

export const defaultKeywords = [
  "Rajvi Social Welfare Trust",
  "NGO India",
  "Education Support NGO",
  "Healthcare Awareness NGO",
  "Women Empowerment NGO",
  "Youth Development NGO",
  "Community Welfare NGO",
  "Environmental Awareness NGO",
  "Volunteer NGO India",
  "Donate NGO India",
];