import { Metadata } from 'next'
import Script from 'next/script'
import { SEO_CONFIG, SITE_URL, generateWebPageSchema, generateBreadcrumbSchema } from '@/lib/seo'

export const metadata: Metadata = {
  title: SEO_CONFIG.acquire.title,
  description: SEO_CONFIG.acquire.description,
  keywords: SEO_CONFIG.acquire.keywords,
  alternates: {
    canonical: `${SITE_URL}/acquire`,
  },
  openGraph: {
    title: SEO_CONFIG.acquire.title,
    description: SEO_CONFIG.acquire.description,
    url: `${SITE_URL}/acquire`,
    siteName: 'Pounce',
    images: [
      {
        url: `${SITE_URL}/og-acquire.png`,
        width: 1200,
        height: 630,
        alt: 'Domain Auctions & Marketplace - Pounce',
      },
    ],
    locale: 'en_US',
    type: 'website',
  },
  twitter: {
    card: 'summary_large_image',
    title: SEO_CONFIG.acquire.title,
    description: SEO_CONFIG.acquire.description,
    images: [`${SITE_URL}/og-acquire.png`],
  },
}

export default function AcquireLayout({
  children,
}: {
  children: React.ReactNode
}) {
  const webPageSchema = generateWebPageSchema({
    title: SEO_CONFIG.acquire.title,
    description: SEO_CONFIG.acquire.description,
    url: `${SITE_URL}/acquire`,
  })
  
  const breadcrumbSchema = generateBreadcrumbSchema([
    { name: 'Home', url: SITE_URL },
    { name: 'Domain Marketplace', url: `${SITE_URL}/acquire` },
  ])

  return (
    <>
      <Script
        id="acquire-webpage-schema"
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(webPageSchema) }}
      />
      <Script
        id="acquire-breadcrumb-schema"
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbSchema) }}
      />
      {children}
    </>
  )
}

