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';
|
|
|
|
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-07 10:00:28 +03:00
|
|
|
};
|
2022-04-28 19:54:33 +03:00
|
|
|
|
2022-09-07 10:00:28 +03:00
|
|
|
export const Header: FC<HeaderComponentProps> = ({ name = 'Your stream title', chatAvailable }) => (
|
|
|
|
<AntHeader className={`${styles.header}`}>
|
|
|
|
<div className={`${styles.logo}`}>
|
|
|
|
<OwncastLogo variant="contrast" />
|
|
|
|
<span>{name}</span>
|
|
|
|
</div>
|
|
|
|
{chatAvailable && <UserDropdown />}
|
|
|
|
{!chatAvailable && (
|
|
|
|
<Tooltip title="Chat is available when the stream is live." placement="left">
|
|
|
|
<Tag color="processing" style={{ cursor: 'pointer' }}>
|
|
|
|
Chat offline
|
|
|
|
</Tag>
|
|
|
|
</Tooltip>
|
|
|
|
)}
|
|
|
|
</AntHeader>
|
|
|
|
);
|
|
|
|
export default Header;
|