import type { Metadata } from 'next';
import { Geist, Blaka } from 'next/font/google';
import localFont from 'next/font/local';
import './globals.css';

const geistSans = Geist({
  variable: '--font-geist-sans',
  subsets: ['latin'],
});

const blaka = Blaka({
  subsets: ['latin'],
  variable: '--font-blaka',
  weight: '400',
});

const iosevkaSlab = localFont({
  src: [
    {
      path: '../../public/fonts/IosevkaSlabQp/IosevkaSlabQp-Regular.woff2',
      weight: '400',
      style: 'normal',
    },
    {
      path: '../../public/fonts/IosevkaSlabQp/IosevkaSlabQp-Bold.woff2',
      weight: '700',
      style: 'normal',
    },
    {
      path: '../../public/fonts/IosevkaSlabQp/IosevkaSlabQp-Heavy.woff2',
      weight: '900',
      style: 'normal',
    },
  ],
  variable: '--font-iosevka-slab',
  display: 'swap',
});

const iosevkaMono = localFont({
  src: [
    {
      path: '../../public/fonts/IosevkaSansMono/IosevkaSansMono-Regular.woff2',
      weight: '400',
      style: 'normal',
    },
    {
      path: '../../public/fonts/IosevkaSansMono/IosevkaSansMono-Bold.woff2',
      weight: '700',
      style: 'normal',
    },
    {
      path: '../../public/fonts/IosevkaSansMono/IosevkaSansMono-Heavy.woff2',
      weight: '900',
      style: 'normal',
    },
  ],
  display: 'swap',
  variable: '--font-iosevka-mono',
});

export const metadata: Metadata = {
  title: 'Dave | DMG',
  description: 'Do not let us die in the dark night of this cold winter, Dave',
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html
      lang="en"
      className={`${geistSans.variable} ${blaka.variable} ${iosevkaSlab.variable} ${iosevkaMono.variable}`}
    >
      <body>{children}</body>
    </html>
  );
}
