import {User} from "@/interfaces/user";
import clsx from "clsx";
import {useRouter} from "next/router";
import Navbar from "../Navbar";
import Sidebar from "../Sidebar";

interface Props {
	user: User;
	children: React.ReactNode;
	className?: string;
	navDisabled?: boolean;
	focusMode?: boolean
	onFocusLayerMouseEnter?: Function;
}

export default function Layout({user, children, className, navDisabled = false, focusMode = false, onFocusLayerMouseEnter }: Props) {
	const router = useRouter();

	return (
		<main className="w-full min-h-full h-screen flex flex-col bg-mti-gray-smoke">
			<Navbar user={user} navDisabled={navDisabled} focusMode={focusMode} onFocusLayerMouseEnter={onFocusLayerMouseEnter} />
			<div className="h-full w-full flex gap-2">
				<Sidebar path={router.pathname} navDisabled={navDisabled} focusMode={focusMode} onFocusLayerMouseEnter={onFocusLayerMouseEnter}/>
				<div
					className={clsx(
						"w-5/6 min-h-full h-fit mr-8 bg-white shadow-md rounded-2xl p-12 pb-8 flex flex-col gap-12 relative overflow-hidden mt-2",
						className,
					)}>
					{children}
				</div>
			</div>
		</main>
	);
}
