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

export const metadata: Metadata = {
  title: 'Blog | Pounce',
  description: 'Operator-grade notes on domains: market mechanics, workflows, verification, and monetization.',
  alternates: { canonical: `${SITE_URL}/blog` },
  openGraph: {
    title: 'Blog | Pounce',
    description: 'Operator-grade notes on domains: market mechanics, workflows, verification, and monetization.',
    url: `${SITE_URL}/blog`,
    type: 'website',
  },
}

export default function BlogLayout({ 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: 'Blog', item: `${SITE_URL}/blog` },
        ],
      },
      {
        '@type': 'CollectionPage',
        name: 'Pounce Blog',
        description: 'Operator-grade notes on domains.',
        url: `${SITE_URL}/blog`,
        isPartOf: { '@type': 'WebSite', name: 'Pounce', url: SITE_URL },
      },
    ],
  }

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

