import LogOutButton from "@Front/Components/DesignSystem/LogOutButton";
import Module from "@Front/Config/Module";
import React from "react";

import NavigationLink from "../../NavigationLink";
import classes from "./classes.module.scss";

type IProps = {
	isOpen: boolean;
	closeModal: () => void;
};
type IState = {};

export default class BurgerModal extends React.Component<IProps, IState> {
	// TODO isEnabled depending on role given by DB
	public override render(): JSX.Element | null {
		if (!this.props.isOpen) return null;
		return (
			<>
				<div className={classes["background"]} onClick={this.props.closeModal} />
				<div className={classes["root"]}>
					<NavigationLink
						path={Module.getInstance().get().modules.pages.Folder.props.path}
						text="Dossiers en cours"
						routesActive={[Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path]}
					/>
					<NavigationLink
						path={Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.props.path}
						text="Dossiers archivés"
						routesActive={[Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.props.path]}
					/>
					<div className={classes["separator"]} />
					<LogOutButton />
				</div>
			</>
		);
	}
}
