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

export const metadata: Metadata = {
  title: 'Contact | Pounce',
  description: 'Support and partnerships. Reach the Pounce team via email.',
  alternates: { canonical: `${SITE_URL}/contact` },
  openGraph: {
    title: 'Contact | Pounce',
    description: 'Support and partnerships. Reach the Pounce team via email.',
    url: `${SITE_URL}/contact`,
    type: 'website',
  },
}

export default function ContactLayout({ 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: 'Contact', item: `${SITE_URL}/contact` },
        ],
      },
      {
        '@type': 'ContactPage',
        name: 'Contact Pounce',
        url: `${SITE_URL}/contact`,
        description: 'Support and partnerships.',
        isPartOf: { '@type': 'WebSite', name: 'Pounce', url: SITE_URL },
      },
    ],
  }

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

