2022-05-26 21:08:37 +03:00
|
|
|
import { Layout, Tag, Tooltip } from 'antd';
|
2022-09-07 10:00:28 +03:00
|
|
|
import { FC } from 'react';
|
2022-11-05 06:04:13 +03:00
|
|
|
import cn from 'classnames';
|
2022-09-07 10:00:28 +03:00
|
|
|
import { UserDropdown } from '../../common/UserDropdown/UserDropdown';
|
|
|
|
import { OwncastLogo } from '../../common/OwncastLogo/OwncastLogo';
|
|
|
|
import styles from './Header.module.scss';
|
2022-04-28 19:54:33 +03:00
|
|
|
|
2022-09-07 10:00:28 +03:00
|
|
|
const { Header: AntHeader } = Layout;
|
2022-04-28 19:54:33 +03:00
|
|
|
|
2022-09-07 10:00:28 +03:00
|
|
|
export type HeaderComponentProps = {
|
2022-05-08 10:41:47 +03:00
|
|
|
name: string;
|
2022-05-26 21:08:37 +03:00
|
|
|
chatAvailable: boolean;
|
2022-09-11 06:03:58 +03:00
|
|
|
chatDisabled: boolean;
|
2022-09-07 10:00:28 +03:00
|
|
|
};
|
2022-04-28 19:54:33 +03:00
|
|
|
|
2022-09-11 06:03:58 +03:00
|
|
|
export const Header: FC<HeaderComponentProps> = ({
|
|
|
|
name = 'Your stream title',
|
|
|
|
chatAvailable,
|
|
|
|
chatDisabled,
|
|
|
|
}) => (
|
2022-11-05 06:04:13 +03:00
|
|
|
<AntHeader className={cn([`${styles.header}`], 'global-header')}>
|
2022-09-07 10:00:28 +03:00
|
|
|
<div className={`${styles.logo}`}>
|
|
|
|
<OwncastLogo variant="contrast" />
|
2022-11-05 06:04:13 +03:00
|
|
|
<span className="global-header-text">{name}</span>
|
2022-09-07 10:00:28 +03:00
|
|
|
</div>
|
2022-09-11 06:03:58 +03:00
|
|
|
{chatAvailable && !chatDisabled && <UserDropdown />}
|
|
|
|
{!chatAvailable && !chatDisabled && (
|
2022-09-07 10:00:28 +03:00
|
|
|
<Tooltip title="Chat is available when the stream is live." placement="left">
|
2022-09-10 22:08:22 +03:00
|
|
|
<Tag style={{ cursor: 'pointer' }}>Chat offline</Tag>
|
2022-09-07 10:00:28 +03:00
|
|
|
</Tooltip>
|
|
|
|
)}
|
|
|
|
</AntHeader>
|
|
|
|
);
|
|
|
|
export default Header;
|