import type { Metadata } from "next";
import { BarHeader } from "@/components/layout/BarHeader";
import { PageContainer } from "@/components/layout/PageContainer";
import { SiteFooter } from "@/components/layout/SiteFooter";
import { WolfBadge } from "@/components/layout/WolfBadge";
import { NetworkShowcase } from "@/components/partners/NetworkShowcase";
import { PartnerDirectory } from "@/components/partners/PartnerDirectory";
import { PartnersHero } from "@/components/partners/PartnersHero";
import { PartnersDisclaimer, PartnersJourney } from "@/components/partners/PartnersClosing";
import { env } from "@/config/env";
import { siteConfig } from "@/config/site";
import { partners } from "@/data/partners";

export const metadata: Metadata = {
  title: "Sterling Protection Partners | Network & Ecosystem",
  description:
    "Explore trusted companies and service providers that work with Sterling Protection Partners to support the needs of our members — from private travel and hospitality to medical assistance, lifestyle services, and secure experiences.",
  alternates: {
    canonical: "/partnership-directory",
  },
  openGraph: {
    title: "Sterling Protection Partners | Network & Ecosystem",
    description:
      "Explore trusted companies and service providers that work with Sterling Protection Partners to support the needs of our members — from private travel and hospitality to medical assistance, lifestyle services, and secure experiences.",
    url: "/partnership-directory",
    type: "website",
    images: [
      {
        url: `${env.siteUrl}/images/partners/hero.png`,
        width: 968,
        height: 689,
        alt: "Sterling Protection Partners Integration Network",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Sterling Protection Partners | Network & Ecosystem",
    description:
      "Explore trusted companies and service providers that work with Sterling Protection Partners to support the needs of our members — from private travel and hospitality to medical assistance, lifestyle services, and secure experiences.",
  },
};

export default function PartnershipDirectoryPage() {
  const directorySchema = {
    "@context": "https://schema.org",
    "@type": "CollectionPage",
    name: "Sterling Protection Partners | Network & Ecosystem",
    headline: "Get to know our Sterling Protection Partners",
    description:
      "Explore trusted companies and service providers that work with Sterling Protection Partners to support the needs of our members — from private travel and hospitality to medical assistance, lifestyle services, and secure experiences.",
    url: `${env.siteUrl}/partnership-directory`,
    mainEntity: {
      "@type": "ItemList",
      name: "Sterling Protection Partners Global Ecosystem",
      description:
        "Curated directory of vetted global partners providing security, travel, lifestyle, and medical assistance.",
      numberOfItems: partners.length,
      itemListElement: partners.map((partner, index) => ({
        "@type": "ListItem",
        position: index + 1,
        name: partner.banner,
        description: `${partner.focus} in ${partner.location}`,
        url: partner.href,
      })),
    },
    publisher: {
      "@type": "Organization",
      name: siteConfig.name,
      url: env.siteUrl,
      logo: {
        "@type": "ImageObject",
        url: `${env.siteUrl}/images/brand/logo.svg`,
        width: 300,
        height: 300,
      },
      foundingDate: "1996",
      founder: {
        "@type": "Person",
        name: "Cedric Tortevoix",
      },
      address: {
        "@type": "PostalAddress",
        streetAddress: "2nd Floor College House, 17 King Edwards Road",
        addressLocality: "Ruislip, London",
        postalCode: "HA4 7AE",
        addressCountry: "GB",
      },
      contactPoint: [
        {
          "@type": "ContactPoint",
          telephone: "+33 7 56 97 66 87",
          contactType: "customer service",
          areaServed: ["FR", "EU"],
          availableLanguage: ["English", "French"],
        },
        {
          "@type": "ContactPoint",
          telephone: "+212 601 999 345",
          contactType: "customer service",
          areaServed: "MA",
          availableLanguage: ["English", "French", "Arabic"],
        },
      ],
      description: siteConfig.description,
    },
  };

  return (
    <PageContainer>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(directorySchema) }}
      />
      <WolfBadge />
      <BarHeader />

      <main>
        <PartnersHero />
        <div className="relative right-1/2 left-1/2 mt-[30px] -mr-[50vw] -ml-[50vw] box-border w-screen px-5 py-[50px]">
          <PartnerDirectory />
          <NetworkShowcase />
        </div>
        <PartnersJourney />
        <PartnersDisclaimer />
      </main>

      <SiteFooter />
    </PageContainer>
  );
}
