import type React from "react"
import type { Metadata } from "next"
import { GeistSans } from "geist/font/sans"
import { GeistMono } from "geist/font/mono"
import { Analytics } from "@vercel/analytics/next"
import { Toaster } from "sonner"
import { NotificationProvider } from "@/contexts/notification-context"
import { I18nProvider } from "@/lib/i18n"
import "./globals.css"
import { Suspense } from "react"

export const metadata: Metadata = {
  title: "GoHorseJobs - Find your next opportunity",
  description: "Connecting candidates and companies quickly and directly",
  generator: "v0.app",
  icons: {
    icon: "/logohorse.png",
    shortcut: "/logohorse.png",
    apple: "/logohorse.png",
  },
}

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode
}>) {
  return (
    <html lang="en">
      <body className={`font-sans ${GeistSans.variable} ${GeistMono.variable} antialiased`}>
        <I18nProvider>
          <NotificationProvider>
            <Suspense fallback={<div>Loading...</div>}>{children}</Suspense>
            <Toaster
              position="top-right"
              richColors
              closeButton
              expand={false}
              duration={4000}
            />
          </NotificationProvider>
        </I18nProvider>
        <Analytics />
      </body>
    </html>
  )
}
