import { Tooltip, Avatar } from 'antd'; import { FC, useEffect, useState } from 'react'; import cn from 'classnames'; import dynamic from 'next/dynamic'; import Link from 'next/link'; import styles from './Header.module.scss'; // Lazy loaded components const UserDropdown = dynamic( () => import('../../common/UserDropdown/UserDropdown').then(mod => mod.UserDropdown), { ssr: false, }, ); export type HeaderComponentProps = { name: string; chatAvailable: boolean; chatDisabled: boolean; online: boolean; }; export const Header: FC = ({ name, chatAvailable, chatDisabled, online }) => { const [canHideChat, setCanHideChat] = useState(false); useEffect(() => { setCanHideChat(window.innerWidth >= 768); }, []); return (
{online ? ( Skip to player ) : ( Skip to offline message )} Skip to page content Skip to footer

{name}

{chatAvailable && !chatDisabled && ( )} {!chatAvailable && !chatDisabled && ( Chat is offline )}
); }; export default Header;