/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
*/
import { Button, Section, Stack } from 'tgui/components';
import { Pane } from 'tgui/layouts';
import { NowPlayingWidget, useAudio } from './audio';
import { ChatPanel, ChatTabs } from './chat';
import { useGame } from './game';
import { Notifications } from './Notifications';
import { PingIndicator } from './ping';
import { SettingsPanel, useSettings } from './settings';
export const Panel = (props, context) => {
// IE8-10: Needs special treatment due to missing Flex support
if (Byond.IS_LTE_IE10) {
return (
);
}
const audio = useAudio(context);
const settings = useSettings(context);
const game = useGame(context);
if (process.env.NODE_ENV !== 'production') {
const { useDebug, KitchenSink } = require('tgui/debug');
const debug = useDebug(context);
if (debug.kitchenSink) {
return (
);
}
}
return (
{audio.visible && (
)}
{settings.visible && (
)}
{game.connectionLostAt && (
Byond.command('.reconnect')}>
Reconnect
)}>
You are either AFK, experiencing lag or the connection
has closed.
)}
{game.roundRestartedAt && (
The connection has been closed because the server is
restarting. Please wait while you automatically reconnect.
)}
);
};
const HoboPanel = (props, context) => {
const settings = useSettings(context);
return (
{settings.visible && (
) || (
)}
);
};