import { Dispatch, FC, SetStateAction } from "react";

import Styled from "./Overlay.style";

export const Overlay: FC<IProps> = ({ setIsOpened }) => {
	return (
		<Styled.Wrapper
			onClick={() => setIsOpened(false)}
			onContextMenu={(e) => {
				e.preventDefault();
				setIsOpened(false);
			}}
			data-testid="overlay"
		></Styled.Wrapper>
	);
};

interface IProps {
	setIsOpened: Dispatch<SetStateAction<boolean>>;
}
