import { Metadata } from 'next'

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

export const metadata: Metadata = {
  title: 'Domain Auctions — Smart Pounce',
  description: 'Find undervalued domain auctions from GoDaddy, Sedo, NameJet, SnapNames & DropCatch. Our Smart Pounce algorithm identifies the best opportunities with transparent valuations.',
  keywords: [
    'domain auctions',
    'expired domains',
    'domain bidding',
    'GoDaddy auctions',
    'Sedo domains',
    'NameJet',
    'domain investment',
    'undervalued domains',
    'domain flipping',
  ],
  openGraph: {
    title: 'Domain Auctions — Smart Pounce by pounce',
    description: 'Find undervalued domain auctions. Transparent valuations, multiple platforms, no payment handling.',
    url: `${siteUrl}/auctions`,
    type: 'website',
    images: [
      {
        url: `${siteUrl}/og-auctions.png`,
        width: 1200,
        height: 630,
        alt: 'Smart Pounce - Domain Auction Aggregator',
      },
    ],
  },
  twitter: {
    card: 'summary_large_image',
    title: 'Domain Auctions — Smart Pounce',
    description: 'Find undervalued domain auctions from GoDaddy, Sedo, NameJet & more.',
  },
  alternates: {
    canonical: `${siteUrl}/auctions`,
  },
}

// JSON-LD for Auctions page
const jsonLd = {
  '@context': 'https://schema.org',
  '@type': 'WebPage',
  name: 'Domain Auctions — Smart Pounce',
  description: 'Aggregated domain auctions from multiple platforms with transparent algorithmic valuations.',
  url: `${siteUrl}/auctions`,
  isPartOf: {
    '@type': 'WebSite',
    name: 'pounce',
    url: siteUrl,
  },
  about: {
    '@type': 'Service',
    name: 'Smart Pounce',
    description: 'Domain auction aggregation and opportunity analysis',
    provider: {
      '@type': 'Organization',
      name: 'pounce',
    },
  },
  mainEntity: {
    '@type': 'ItemList',
    name: 'Domain Auctions',
    description: 'Live domain auctions from GoDaddy, Sedo, NameJet, SnapNames, and DropCatch',
    itemListElement: [
      {
        '@type': 'ListItem',
        position: 1,
        name: 'GoDaddy Auctions',
        url: 'https://auctions.godaddy.com',
      },
      {
        '@type': 'ListItem',
        position: 2,
        name: 'Sedo',
        url: 'https://sedo.com',
      },
      {
        '@type': 'ListItem',
        position: 3,
        name: 'NameJet',
        url: 'https://namejet.com',
      },
    ],
  },
}

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

