import type { Metadata } from "next";
import type { ReactNode } from "react";
import { detectImageFaqSchema } from "../../../lib/schema/faq";

export function generateMetadata(): Metadata {
  const baseUrl = process.env.NEXT_PUBLIC_APP_URL || "https://www.kleboai.com";

  return {
    title: "Free AI Image Detector",
    description:
      "Upload any image and get instant AI detection results. KleboAI analyzes images to determine if they're human-made or AI-generated.",
    alternates: {
      canonical: `${baseUrl}/detect-image`,
    },
  };
}

export default function DetectImageLayout({
  children,
}: {
  children: ReactNode;
}) {
  return (
    <>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{
          __html: JSON.stringify(detectImageFaqSchema),
        }}
      />
      {children}
    </>
  );
}
