import React from "react";
import classes from "./classes.module.scss";
import NavigationLink from "../../NavigationLink";
import LogOutButton from "@Front/Components/DesignSystem/LogOutButton";
import Module from "@Front/Config/Module";

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

export default class ProfileModal 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.MyAccount.props.path} text="Mon compte" />
					<NavigationLink text="CGU" />
					<NavigationLink path={Module.getInstance().get().modules.pages.Home.props.path} text="Home" />
					<div className={classes["separator"]} />
					<LogOutButton />
				</div>
			</>
		);
	}
}
