import React, { lazy, memo } from 'react'; import { ServerContext } from '@/state/server'; import Can from '@/components/elements/Can'; import ContentContainer from '@/components/elements/ContentContainer'; import tw from 'twin.macro'; import ServerContentBlock from '@/components/elements/ServerContentBlock'; import ServerDetailsBlock from '@/components/server/ServerDetailsBlock'; import isEqual from 'react-fast-compare'; import PowerControls from '@/components/server/PowerControls'; import { EulaModalFeature, JavaVersionModalFeature } from 'feature/index'; import ErrorBoundary from '@/components/elements/ErrorBoundary'; import Spinner from '@/components/elements/Spinner'; export type PowerAction = 'start' | 'stop' | 'restart' | 'kill'; const ChunkedConsole = lazy(() => import(/* webpackChunkName: "console" */'@/components/server/Console')); const ChunkedStatGraphs = lazy(() => import(/* webpackChunkName: "graphs" */'@/components/server/StatGraphs')); const ServerConsole = () => { const isInstalling = ServerContext.useStoreState(state => state.server.data!.isInstalling); const isTransferring = ServerContext.useStoreState(state => state.server.data!.isTransferring); const eggFeatures = ServerContext.useStoreState(state => state.server.data!.eggFeatures, isEqual); return (
{isInstalling ?

This server is currently running its installation process and most actions are unavailable.

: isTransferring ?

This server is currently being transferred to another node and all actions are unavailable.

: }
{eggFeatures.includes('eula') && } {eggFeatures.includes('java_version') && }
); }; export default memo(ServerConsole, isEqual);