import type { Metadata } from 'next'
import Script from 'next/script'
import { SITE_URL } from '@/lib/seo'

export const metadata: Metadata = {
  title: 'Pounce Direct | Verified Domain Listings',
  description: 'Browse DNS-verified domain listings. Clean workflow, zero commission, and operator-grade trust signals.',
  alternates: { canonical: `${SITE_URL}/buy` },
  openGraph: {
    title: 'Pounce Direct | Verified Domain Listings',
    description: 'Browse DNS-verified domain listings with operator-grade trust signals.',
    url: `${SITE_URL}/buy`,
    type: 'website',
  },
}

export default function BuyLayout({ children }: { children: React.ReactNode }) {
  const schema = {
    '@context': 'https://schema.org',
    '@graph': [
      {
        '@type': 'BreadcrumbList',
        itemListElement: [
          { '@type': 'ListItem', position: 1, name: 'Home', item: SITE_URL },
          { '@type': 'ListItem', position: 2, name: 'Pounce Direct', item: `${SITE_URL}/buy` },
        ],
      },
      {
        '@type': 'CollectionPage',
        name: 'Pounce Direct Listings',
        description: 'DNS-verified domain listings on Pounce.',
        url: `${SITE_URL}/buy`,
        isPartOf: { '@type': 'WebSite', name: 'Pounce', url: SITE_URL },
      },
    ],
  }

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

