import type { Metadata } from 'next';

export const metadata: Metadata = {
  title: 'The Crew Lounge — Broadcast Beat',
  description: 'The Crew Lounge: connect with broadcast, motion picture and post production professionals worldwide. Discuss live production, IP workflows, streaming, audio, cameras, AI automation, and more.',
  alternates: { canonical: '/forum' },
  openGraph: {
    title: 'The Crew Lounge — Broadcast Beat',
    description: 'The Crew Lounge: connect with broadcast, motion picture and post production professionals worldwide. Ask questions, share expertise, and discuss broadcast technology.',
    url: '/forum',
    type: 'website',
  },
  twitter: {
    card: 'summary',
    title: 'The Crew Lounge — Broadcast Beat',
    description: 'The Crew Lounge: connect with broadcast, motion picture and post production professionals worldwide on Broadcast Beat.',
  },
};

export default function ForumLayout({ children }: { children: React.ReactNode }) {
  const schema = {
    '@context': 'https://schema.org',
    '@type': 'WebPage',
    name: 'Broadcast Beat — The Crew Lounge',
    description: 'The Crew Lounge: an industry community for broadcast, motion picture and post production professionals worldwide.',
    url: 'https://broadcastbeat.com/forum',
    isPartOf: {
      '@type': 'WebSite',
      name: 'Broadcast Beat',
      url: 'https://broadcastbeat.com',
    },
    breadcrumb: {
      '@type': 'BreadcrumbList',
      itemListElement: [
        { '@type': 'ListItem', position: 1, name: 'Home', item: 'https://broadcastbeat.com' },
        { '@type': 'ListItem', position: 2, name: 'The Crew Lounge', item: 'https://broadcastbeat.com/forum' },
      ],
    },
  };

  return (
    <>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
      />
      {children}
    </>
  );
}
