import React from "react";
import classes from "./classes.module.scss";
import Image from "next/image";
import BurgerIcon from "@Assets/Icons/burger.svg";
import CrossIcon from "@Assets/Icons/cross.svg";
import BurgerModal from "./BurgerModal";

type IProps = {
	isModalOpen: boolean;
	openBurgerMenu: () => void;
	closeBurgerMenu: () => void;
};
type IState = {
	// isModalOpen: boolean;
};

export default class BurgerMenu extends React.Component<IProps, IState> {
	constructor(props: IProps) {
		super(props);
	}

	public override render(): JSX.Element {
		return (
			<div className={classes["root"]}>
				<Image
					alt="burger"
					src={this.props.isModalOpen ? CrossIcon : BurgerIcon}
					className={classes["burger-icon"]}
					onClick={this.props.openBurgerMenu}
				/>
				{this.props.isModalOpen && <BurgerModal isOpen={this.props.isModalOpen} closeModal={this.props.closeBurgerMenu} />}
			</div>
		);
	}
}
