import { Metadata } from 'next'

const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://pounce.ch'

export const metadata: Metadata = {
  title: 'TLD Pricing — Compare 886+ Domain Extensions',
  description: 'Compare domain registration prices across 886+ TLDs. Find the cheapest registrars for .com, .io, .ai, .dev and more. Updated daily with real pricing data.',
  keywords: [
    'TLD pricing',
    'domain prices',
    'registrar comparison',
    'domain extension prices',
    '.com price',
    '.io price',
    '.ai price',
    '.dev price',
    'cheapest domain registrar',
    'domain cost comparison',
  ],
  openGraph: {
    title: 'TLD Pricing — Compare 886+ Domain Extensions',
    description: 'Find the cheapest registrar for any domain extension. Compare prices across 886+ TLDs.',
    url: `${siteUrl}/tld-pricing`,
    type: 'website',
    images: [
      {
        url: `${siteUrl}/og-tld-pricing.png`,
        width: 1200,
        height: 630,
        alt: 'TLD Pricing Comparison - pounce',
      },
    ],
  },
  twitter: {
    card: 'summary_large_image',
    title: 'TLD Pricing — Compare 886+ TLDs',
    description: 'Find the cheapest registrar for any domain extension.',
  },
  alternates: {
    canonical: `${siteUrl}/tld-pricing`,
  },
}

// JSON-LD for TLD Pricing
const jsonLd = {
  '@context': 'https://schema.org',
  '@type': 'WebPage',
  name: 'TLD Pricing Comparison',
  description: 'Compare domain registration prices across 886+ top-level domains',
  url: `${siteUrl}/tld-pricing`,
  isPartOf: {
    '@type': 'WebSite',
    name: 'pounce',
    url: siteUrl,
  },
  mainEntity: {
    '@type': 'ItemList',
    name: 'Top-Level Domains',
    description: 'Comprehensive list of TLD pricing from major registrars',
    numberOfItems: 886,
    itemListElement: [
      { '@type': 'ListItem', position: 1, name: '.com', description: 'Most popular generic TLD' },
      { '@type': 'ListItem', position: 2, name: '.net', description: 'Network-focused TLD' },
      { '@type': 'ListItem', position: 3, name: '.org', description: 'Organization TLD' },
      { '@type': 'ListItem', position: 4, name: '.io', description: 'Tech startup favorite' },
      { '@type': 'ListItem', position: 5, name: '.ai', description: 'AI and tech industry TLD' },
    ],
  },
}

export default function TldPricingLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
      />
      {children}
    </>
  )
}

