import type {Metadata} from "next";
import {Roboto} from "next/font/google";
import "../globals.css";
import Footer from "@/components/Public/Footer";
import AdminSideBar from "@/app/(admin)/_components/_admin_sidebar";
import {Toaster} from "@/components/ui/toaster";
import {useIsAdmin} from "@/lib/hooks/useIsAdmin";

const roboto = Roboto({subsets: ["latin"], weight: "400"});

export const metadata: Metadata = {
    title: "Admin | Asikhulume Chat Therapy Eswatini",
    description: "Asikhulume Chat Therapy is an innovative mobile platform that connects you with professional counselors, therapists, and mental health experts, providing accessible and convenient mental health services.",
};

export default async function RootLayout({children,}: Readonly<{ children: React.ReactNode; }>) {

    await useIsAdmin();

    return (
        <html lang="en">
        <body className={roboto.className}>
        <div className="flex min-h-screen w-full flex-col bg-muted/40">
            <AdminSideBar/>
            <main className="min-h-screen w-full sm:pl-14">
                {children}
                <Footer/>
            </main>
        </div>
        <Toaster/>
        </body>
        </html>
    );
}
