import './globals.css'
import Script from 'next/script';

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="ru">
      <link rel="alternate" type="application/rss+xml" title="Хобби и ты" href="https://blogbaster.xyz/api/podcasts/hobbits/rss"/>
      <link rel="alternate" type="application/rss+xml" title="Поуехали" href="https://blogbaster.xyz/api/podcasts/lets-go/rss"/>
      <link rel="alternate" type="application/rss+xml" title="Нравится слушать" href="https://blogbaster.xyz/api/podcasts/like-to-listen/rss"/>
      <Script id="metrika-counter" strategy="afterInteractive">
          {`(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
            m[i].l=1*new Date();
            for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
            k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
            (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
 
            ym(92472121, "init", {
                  defer: true,
                  clickmap:true,
                  trackLinks:true,
                  accurateTrackBounce:true,
                  webvisor:true
            });`
          }
        </Script>
      <head />
      <body>{children}</body>
    </html>
  )
}