File size: 782 Bytes
41a71fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { KeyboardEvent } from 'react';
import { classNames } from '@/shared/lib/classNames/classNames';
import cls from './Burger.module.scss';

interface BurgerProps {
    className?: string;
    isBurgerActive: boolean;
    onClick: () => void;
}
export const Burger = ({ className, isBurgerActive, onClick }: BurgerProps) => {
    return (
        // eslint-disable-next-line jsx-a11y/control-has-associated-label
        <div
            className={classNames(cls.Burger, { [cls.active]: isBurgerActive }, [className])}
            onClick={onClick}
            onKeyDown={(e: KeyboardEvent<HTMLElement>) => e.code === 'Enter' && onClick()}
            role="button"
            tabIndex={0}
        >
            <span className={cls.burger__strip} />
        </div>
    );
};