import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import './global.css';
import {ModalProvider} from "@/components/Modal/ModalContext";
import {CarColorProvider} from "@/api/context/CarColor";
import {BodyTypeProvider} from "@/api/context/BodyType";
import {CarProvider} from "@/api/context/Car";
import {CarBrandProvider} from "@/api/context/CarBrand";
import {CarModelProvider} from "@/api/context/CarModel";
import {CustomerProvider} from "@/api/context/Customer";
import {EngineProvider} from "@/api/context/Engine";
import {SaleProvider} from "@/api/context/Sale";
import {TransmissionProvider} from "@/api/context/Transmission";
import {TrimProvider} from "@/api/context/Trim";

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

const geistMono = Geist_Mono({
  variable: "--font-geist-mono",
  subsets: ["latin"],
});

export const metadata: Metadata = {
  title: "Create Next App",
  description: "Generated by create next app",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <body
        className={`${geistSans.variable} ${geistMono.variable} antialiased`}
      >
        <BodyTypeProvider>
            <CarProvider>
                <CarBrandProvider>
                    <CarModelProvider>
                        <CustomerProvider>
                            <EngineProvider>
                                <SaleProvider>
                                    <TransmissionProvider>
                                        <TrimProvider>
                                            <CarColorProvider>
                                                <ModalProvider>
                                                    {children}
                                                </ModalProvider>
                                            </CarColorProvider>
                                        </TrimProvider>
                                    </TransmissionProvider>
                                </SaleProvider>
                            </EngineProvider>
                        </CustomerProvider>
                    </CarModelProvider>
                </CarBrandProvider>
            </CarProvider>
        </BodyTypeProvider>
      </body>
    </html>
  );
}
