import type {Metadata} from "next";
import {Roboto} from "next/font/google";
import "../globals.css";
import Footer from "@/components/Public/Footer";
import {Toaster} from "@/components/ui/toaster";
import ClientsHeader from "@/app/(clients)/_components/_clients_header";
import PatientsHeader from "@/app/(patients)/_components/_patients_header";
import PatientsSideNavigation from "@/app/(patients)/_components/_patients_side_nav";
import {Button} from "@/components/ui/button";
import {useIsPatient} from "@/lib/hooks/useIsPatient";

const roboto = Roboto({subsets: ["latin"], weight: "400"});

export const metadata: Metadata = {
    title: "LulamaChat Eswatini | Application",
    description: "LulamaChat 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; }>) {

    // logout non-patient users from accessing patient urls
    await useIsPatient();

    return (
        <html lang="en">
        <body className={roboto.className}>
        {/*"grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]"*/}
        <PatientsSideNavigation/>
        <div className="md:ml-[220px] lg:ml-[240px]">
            <PatientsHeader/>
            <div className={"pt-4"}>
                {children}
            </div>
        </div>
        <Toaster/>
        </body>
        </html>
    );
}
