import type { Metadata } from "next";
import { Halant } from "next/font/google";
import { Inter } from "next/font/google";
import { Public_Sans } from "next/font/google";
import "./globals.css";
import { ServiceWrapper } from "@/components/ServiceWrapper";
import Tag from "@/tag/Tag";
import { getVisualEditScript } from "@/utils/visual-edit-script";

const halant = Halant({
  variable: "--font-halant",
  subsets: ["latin"],
  weight: ["300", "400", "500", "600", "700"],
});

const inter = Inter({
  variable: "--font-inter",
  subsets: ["latin"],
});

const publicSans = Public_Sans({
  variable: "--font-public-sans",
  subsets: ["latin"],
});

export const metadata: Metadata = {
  title: "Masjid Wisata NR - Pusat Ibadah & Kegiatan Umat",
  description: "Masjid Wisata NR menyediakan tempat ibadah berkualitas dengan program komunitas, donasi transparan, dan fasilitas lengkap untuk jamaah dan pengunjung.",
  keywords: "masjid, wisata religi, donasi, ibadah, komunitas, kajian islam, program sosial",
  metadataBase: new URL("https://masjidwisatanr.com"),
  alternates: {
    canonical: "https://masjidwisatanr.com",
  },
  openGraph: {
    title: "Masjid Wisata NR",
    description: "Pusat Ibadah & Kegiatan Umat - Bergabunglah dengan komunitas kami yang hangat dan bermakna.",
    url: "https://masjidwisatanr.com",
    siteName: "Masjid Wisata NR",
    images: [
      {
        url: "http://img.b2bpic.net/free-photo/low-angle-shot-alhambra-palace-granada-spain_181624-51763.jpg",
        alt: "Masjid Wisata NR",
      },
    ],
    type: "website",
  },
  twitter: {
    card: "summary_large_image",
    title: "Masjid Wisata NR",
    description: "Pusat Ibadah & Kegiatan Umat",
    images: ["http://img.b2bpic.net/free-photo/low-angle-shot-alhambra-palace-granada-spain_181624-51763.jpg"],
  },
  robots: {
    index: true,
    follow: true,
  },
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en" suppressHydrationWarning>
      <ServiceWrapper>
        <body
          className={`${halant.variable} ${inter.variable} ${publicSans.variable} antialiased`}
        >
          <Tag />
          {children}
          <script
              dangerouslySetInnerHTML={{
                  __html: `${getVisualEditScript()}`
          }}
        />
        </body>
      </ServiceWrapper>
    </html>
  );
}