import React, { useContext } from 'react'; import PropTypes from 'prop-types'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { Layout, Menu } from 'antd'; import { SettingOutlined, HomeOutlined, LineChartOutlined, CloseCircleOutlined, PlayCircleFilled, StopFilled, MinusSquareFilled, } from '@ant-design/icons'; import classNames from 'classnames'; import OwncastLogo from './logo'; import { BroadcastStatusContext } from '../utils/broadcast-status-context'; import adminStyles from '../../styles/styles.module.css'; export default function MainLayout(props) { const { children } = props; const context = useContext(BroadcastStatusContext); const { broadcastActive } = context || {}; const router = useRouter(); const { route } = router || {}; const { Header, Footer, Content, Sider } = Layout; const { SubMenu } = Menu; const statusIcon = broadcastActive ? : ; const statusMessage = broadcastActive ? 'Online' : 'Offline'; const appClass = classNames({ 'owncast-layout': true, [adminStyles.online]: broadcastActive, }) return (

Owncast Admin

}> Home } title="Stream Details"> Broadcaster Info Viewers Connected Clients Hardware { broadcastActive ? ( }> Disconnect Stream... ) : null} } title="Utilities"> Update Server Configuration Change Stream Key
{statusMessage} {statusIcon}
{children}
); } MainLayout.propTypes = { children: PropTypes.element.isRequired, };