import type { Metadata } from "next";
import { FaqSection } from "@/components/faq/FaqSection";
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 { env } from "@/config/env";
import { siteConfig } from "@/config/site";
import { FAQS } from "@/data/faqs";
import { ROUTES } from "@/lib/routes";

export const metadata: Metadata = {
  title: "Frequently Asked Questions (FAQ) | Sterling Protection Partners LTD",
  description:
    "Explore frequently asked questions regarding Sterling Protection Partners memberships, bespoke executive protection, travel risk management, and family office support.",
  alternates: {
    canonical: "/faq",
  },
  openGraph: {
    title: "Frequently Asked Questions (FAQ) | Sterling Protection Partners LTD",
    description:
      "Explore frequently asked questions regarding Sterling Protection Partners memberships, bespoke executive protection, travel risk management, and family office support.",
    url: "/faq",
    type: "website",
    images: [
      {
        url: `${env.siteUrl}/images/brand/logo.svg`,
        width: 300,
        height: 300,
        alt: "Sterling Protection Partners Logo",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Frequently Asked Questions (FAQ) | Sterling Protection Partners LTD",
    description:
      "Explore frequently asked questions regarding Sterling Protection Partners memberships, bespoke executive protection, travel risk management, and family office support.",
  },
};

export default function FaqPage() {
  const faqSchema = {
    "@context": "https://schema.org",
    "@type": "FAQPage",
    name: "Frequently Asked Questions | Sterling Protection Partners",
    description:
      "Frequently asked questions about Sterling Protection Partners private memberships, secure travel, family office integration, and global close protection.",
    url: `${env.siteUrl}/faq`,
    mainEntity: FAQS.map((faq) => ({
      "@type": "Question",
      name: faq.question,
      acceptedAnswer: {
        "@type": "Answer",
        text: faq.answer,
      },
    })),
    publisher: {
      "@type": "Organization",
      name: siteConfig.name,
      alternateName: siteConfig.shortName,
      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",
        jobTitle: "Founder & Director",
      },
      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(faqSchema) }}
      />
      <WolfBadge />
      <BarHeader activeHref={ROUTES.faq} />

      <main>
        <FaqSection />
      </main>

      <SiteFooter />
    </PageContainer>
  );
}
